Skip to content

Commit

Permalink
Add module to SemanticTokenTypes (#1137)
Browse files Browse the repository at this point in the history
* Add module to SemanticTokenTypes

* Update HighlightingTests.fs
  • Loading branch information
nojaf authored Jul 10, 2023
1 parent 5d5ffe8 commit 8a58226
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/FsAutoComplete/LspHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ module ClassificationUtils =
/// computation expressions
| Cexpr = 23
| Text = 24
| Module = 25

[<RequireQualifiedAccess; Flags>]
type SemanticTokenModifier =
Expand Down Expand Up @@ -502,7 +503,7 @@ module ClassificationUtils =
| SemanticClassificationType.Property -> SemanticTokenTypes.Property, []
| SemanticClassificationType.MutableVar
| SemanticClassificationType.MutableRecordField -> SemanticTokenTypes.Member, [ SemanticTokenModifier.Mutable ]
| SemanticClassificationType.Module
| SemanticClassificationType.Module -> SemanticTokenTypes.Module, []
| SemanticClassificationType.Namespace -> SemanticTokenTypes.Namespace, []
| SemanticClassificationType.Printf -> SemanticTokenTypes.Regexp, []
| SemanticClassificationType.ComputationExpression -> SemanticTokenTypes.Cexpr, []
Expand Down
2 changes: 1 addition & 1 deletion test/FsAutoComplete.Tests.Lsp/HighlightingTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ let tests state =
tokenIsOfType (3, 52) ClassificationUtils.SemanticTokenTypes.Type fullHighlights // the `string` type annotation in the PooPoo srtp member
tokenIsOfType (6, 21) ClassificationUtils.SemanticTokenTypes.EnumMember fullHighlights // the `PeePee` AP application in the `yeet` function definition
tokenIsOfType (9, 10) ClassificationUtils.SemanticTokenTypes.Type fullHighlights //the `SomeJson` type alias should be a type
tokenIsOfType (15, 2) ClassificationUtils.SemanticTokenTypes.Namespace fullHighlights ] ] // tests that module coloration isn't overwritten by function coloration when a module function is used, so Foo in Foo.x should be module-colored
tokenIsOfType (15, 2) ClassificationUtils.SemanticTokenTypes.Module fullHighlights ] ] // tests that module coloration isn't overwritten by function coloration when a module function is used, so Foo in Foo.x should be module-colored

0 comments on commit 8a58226

Please sign in to comment.