Skip to content

Commit 76bcac1

Browse files
committed
[feat] syntactic syntactic tokens
Use the GHC AST and lsp semantic tokens to convince the language server to give highlighting even without any editor highlighting plugins.
1 parent c1dac38 commit 76bcac1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Internal.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import qualified Data.Map.Strict as M
3434
import Data.Maybe
3535
import Data.Text (Text)
3636
import qualified Data.Text as T
37+
import Debug.Trace
3738
import Development.IDE (Action,
3839
GetDocMap (GetDocMap),
3940
GetHieAst (GetHieAst),

plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Types.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
{-# LANGUAGE OverloadedStrings #-}
66
{-# LANGUAGE StrictData #-}
77
{-# LANGUAGE TypeFamilies #-}
8-
{-# LANGUAGE DeriveAnyClass #-}
98

109
module Ide.Plugin.SemanticTokens.Types where
1110

@@ -181,6 +180,7 @@ data SemanticLog
181180
| LogConfig SemanticTokensConfig
182181
| LogMsg String
183182
| LogNoVF
183+
| LogSyntacticTokens RangeHsSyntacticTokenTypes
184184
| LogSemanticTokensDeltaMisMatch Text (Maybe Text)
185185

186186
instance Pretty SemanticLog where
@@ -194,5 +194,4 @@ instance Pretty SemanticLog where
194194
-> "SemanticTokensDeltaMisMatch: previousIdFromRequest: " <> pretty previousIdFromRequest
195195
<> " previousIdFromCache: " <> pretty previousIdFromCache
196196
LogDependencyError err -> "SemanticTokens' dependency error: " <> pretty err
197-
198197
type SemanticTokenId = Text

0 commit comments

Comments
 (0)