Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module to SemanticTokenTypes #1137

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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