Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Feb 9, 2024
1 parent bdc9e50 commit 924fa98
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ defmodule ElixirLS.LanguageServer.Providers.SelectionRanges do
This module provides document/selectionRanges support
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_selectionRange
There is no one good way to get selection ranges that is bot robust and accurate. This module uses a combination of
different approaches. Each produces different ranges (possibly contradictory) that are finally merged and combined
Algorithms providers currently used:
1. Token pairs (), [], do-end etc. with stop tokens , ; eol eof |
2. Special token groups (regular/charlist strings/heredocs) and sigils
3. Comment blocks
4. Code.Fragment.surround_context
5. AST
First 3 algorithms reuse passes from folding ranges provider with some modifications
"""

alias ElixirLS.LanguageServer.{SourceFile}
alias ElixirLS.LanguageServer.SourceFile
alias ElixirLS.LanguageServer.Providers.FoldingRange
import ElixirLS.LanguageServer.Protocol
import ElixirLS.LanguageServer.RangeUtils
Expand Down

0 comments on commit 924fa98

Please sign in to comment.