@@ -34,7 +34,6 @@ import qualified Data.Map.Strict as M
3434import Data.Maybe
3535import Data.Text (Text )
3636import qualified Data.Text as T
37- import Debug.Trace
3837import Development.IDE (Action ,
3938 GetDocMap (GetDocMap ),
4039 GetHieAst (GetHieAst ),
@@ -61,7 +60,6 @@ import Development.IDE.GHC.Compat.Util (mkFastString)
6160import GHC.Parser.Annotation
6261import Ide.Logger (logWith )
6362import Ide.Plugin.Error (PluginError (PluginInternalError , PluginRuleFailed ),
64- getNormalizedFilePathE ,
6563 handleMaybe ,
6664 handleMaybeM )
6765import Ide.Plugin.SemanticTokens.Mappings
@@ -73,10 +71,9 @@ import Ide.Types
7371import qualified Language.LSP.Protocol.Lens as L
7472import Language.LSP.Protocol.Message (MessageResult ,
7573 Method (Method_TextDocumentSemanticTokensFull , Method_TextDocumentSemanticTokensFullDelta ))
76- import Language.LSP.Protocol.Types (NormalizedFilePath ,
74+ import Language.LSP.Protocol.Types (NormalizedUri , toNormalizedUri , fromNormalizedUri , getUri ,
7775 Range ,
7876 SemanticTokens ,
79- fromNormalizedFilePath ,
8077 type (|? ) (InL , InR ))
8178import Prelude hiding (span )
8279import qualified StmContainers.Map as STM
@@ -100,8 +97,8 @@ computeSemanticTokens recorder pid _ nuri = do
10097 semanticId <- lift getAndIncreaseSemanticTokensId
10198
10299 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
105102 let mk w u (toks, mapping) = map (\ (ran, tok) -> (toCurrentRange mapping ran, w tok)) $ u toks
106103 maybeToExceptT (PluginRuleFailed " no syntactic nor semantic tokens" ) $ hoistMaybe $
107104 (mk HsSyntacticTokenType rangeSyntacticList <$> rangesyntacticTypes)
0 commit comments