@@ -34,7 +34,6 @@ import qualified Data.Map.Strict as M
34
34
import Data.Maybe
35
35
import Data.Text (Text )
36
36
import qualified Data.Text as T
37
- import Debug.Trace
38
37
import Development.IDE (Action ,
39
38
GetDocMap (GetDocMap ),
40
39
GetHieAst (GetHieAst ),
@@ -61,7 +60,6 @@ import Development.IDE.GHC.Compat.Util (mkFastString)
61
60
import GHC.Parser.Annotation
62
61
import Ide.Logger (logWith )
63
62
import Ide.Plugin.Error (PluginError (PluginInternalError , PluginRuleFailed ),
64
- getNormalizedFilePathE ,
65
63
handleMaybe ,
66
64
handleMaybeM )
67
65
import Ide.Plugin.SemanticTokens.Mappings
@@ -73,10 +71,9 @@ import Ide.Types
73
71
import qualified Language.LSP.Protocol.Lens as L
74
72
import Language.LSP.Protocol.Message (MessageResult ,
75
73
Method (Method_TextDocumentSemanticTokensFull , Method_TextDocumentSemanticTokensFullDelta ))
76
- import Language.LSP.Protocol.Types (NormalizedFilePath ,
74
+ import Language.LSP.Protocol.Types (NormalizedUri , toNormalizedUri , fromNormalizedUri , getUri ,
77
75
Range ,
78
76
SemanticTokens ,
79
- fromNormalizedFilePath ,
80
77
type (|? ) (InL , InR ))
81
78
import Prelude hiding (span )
82
79
import qualified StmContainers.Map as STM
@@ -100,8 +97,8 @@ computeSemanticTokens recorder pid _ nuri = do
100
97
semanticId <- lift getAndIncreaseSemanticTokensId
101
98
102
99
tokenList <- sortOn fst <$> do
103
- rangesyntacticTypes <- lift $ useWithStale GetSyntacticTokens nfp
104
- rangesemanticTypes <- lift $ useWithStale GetSemanticTokens nfp
100
+ rangesyntacticTypes <- lift $ useWithStale GetSyntacticTokens nuri
101
+ rangesemanticTypes <- lift $ useWithStale GetSemanticTokens nuri
105
102
let mk w u (toks, mapping) = map (\ (ran, tok) -> (toCurrentRange mapping ran, w tok)) $ u toks
106
103
maybeToExceptT (PluginRuleFailed " no syntactic nor semantic tokens" ) $ hoistMaybe $
107
104
(mk HsSyntacticTokenType rangeSyntacticList <$> rangesyntacticTypes)
0 commit comments