-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement semantic tokens plugin to support semantic highlighting(tex…
…tDocument/semanticTokens/full) (#3892) * Implement semantic tokens lsp plugin draft * SemanticTokens: combine information extracted from HieAst * clean up * map to default token types in lsp * use lsp makeSemanticTokens to convert to lsp SemanticTokens type * add test and cleanup * refine semantic type to default one in lsp * Use tokens from hieAst instead of renamedSource and add test * use customize RefMap to get semantic type * use refMap from useAsts * Also compute imported names * Also compute semantic type from TyThing * Fix dependencies version * fix version * Retrieve nameSet from renamedSource to prevent names not visible(Such as by instance deriving) being handled * add hlint config to ignore test data * cean up test data * revert flake.nix * Rename query.hs to Query.hs * Build: add semantic tokens to lts21 * Refactor and add README * Semantic token, filter names in Ast * CI: add consistancy check for wether semantic tokens computations is stable across different ghc versions * Update documentation, cleanup test, remove default modifiers * Fix: IO now classfied to TTypcon, add test for GADT and data family, Update documentation * Restore stack.yaml * fix stack build * Refactor, move out ActualToken to Mappings and use ide logger * Refactor: toLspTokenType should return Maybe type * Stop use stale hieAst * add getImportedNameSemanticRule rule to semantic tokens plugin * do not retrieve hie in getImportedNameSemanticRule * fix: add description for semantic tokens * remove TValBind and TPaternBind and Use TFunction and TVariable instead * cleanup * Refactor useWithStaleMT and took care of the token range using position map * fix build for 9.4 * refactor, use golden test * refactor, use ExceptT for computeSemanticTokens * Fix 9.2 * add persistentSemanticMapRule to prevent semantic tokens block on startup * Fix, use hieKind instead of cast the type directly * add options to turn semantic tokens on and off * Disable stan plugin by default (#3917) * Fix positionMapping in stale data (#3920) * Fix positionMapping in stale data * add test for updatePositionMapping * add comment to demonstrate addOldDelta * cleanup * fix: for local variable, extract type from contextInfo instead of bind site, thus function in pattern binds can also be indentified * clean up * Update plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Query.hs Co-authored-by: Michael Peyton Jones <[email protected]> * refactor: remove TNothing and compact the test output * refactor: rename SemanticTokenType to HsSemanticTokenType to avoid confusion with lsp' SemanticTokenTypes * refactor: push the computation of semantic token type to getSemanticTokensRule * update documentation * cleanup hieAstSpanNames * remove renamed source from getSemanticTokensRule and optimize query function for semantic token type * try to exclude names that is not visible in hie and cleanup * add HieFunMaskKind, it is to differ wether a type at type index is a function or non-function * expose function flag to expose (=>, ->, -=>, ==>) * 1. Relax GetDocMap kindMap to get TyThing for more than type variables. 2. Backport isVisibleFunArg * use customize logger, add test for unicode * fix: handle unicode in semantic tokens * update KindMap to TyThingMap * cleanup * add realSrcSpanToCodePointRange, realSrcLocToCodePointPosition to Development.IDE.GHC.Error * add Note [Semantic information from Multiple Sources] * move recoverFunMaskArray to Mappings.hs * fix test, data.Set might not appear * fix: handle semantic tokens with more than one ast * fix: instance PluginMethod Request Method_TextDocumentSemanticTokensFull * clean up * turn semantic tokens off by default * fix doc * clean up doc --------- Co-authored-by: fendor <[email protected]> Co-authored-by: Michael Peyton Jones <[email protected]>
- Loading branch information
1 parent
9741233
commit 37925a0
Showing
76 changed files
with
1,756 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- ignore: { "within": 'test/testdata/*.hs' } |
Oops, something went wrong.