Skip to content

Commit

Permalink
Decouple SemanticHighlight's request and listener logic
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Dec 18, 2023
1 parent 9b74a2b commit 733dccd
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 418 deletions.
5 changes: 3 additions & 2 deletions lib/ruby_lsp/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,12 @@ def initialize_request(options)
end

semantic_tokens_provider = if enabled_features["semanticHighlighting"]
require_relative "listeners/semantic_highlighting"
Interface::SemanticTokensRegistrationOptions.new(
document_selector: { scheme: "file", language: "ruby" },
legend: Interface::SemanticTokensLegend.new(
token_types: Requests::SemanticHighlighting::TOKEN_TYPES.keys,
token_modifiers: Requests::SemanticHighlighting::TOKEN_MODIFIERS.keys,
token_types: Listeners::SemanticHighlighting::TOKEN_TYPES.keys,
token_modifiers: Listeners::SemanticHighlighting::TOKEN_MODIFIERS.keys,
),
range: true,
full: { delta: false },
Expand Down
Loading

0 comments on commit 733dccd

Please sign in to comment.