Colour from what the compiler concluded - #926
Merged
Merged
Conversation
`textDocument/semanticTokens/full`. The last thing on the advertised list that this server did not answer, and the one an editor cannot do for itself: a TextMate grammar guesses from spelling, so `Console` and `console` look the same to it and a name is a name whatever it turned out to be. The split between a keyword and a name is the lexer's own, so it cannot drift from the one the parser uses. What a name stands for is the resolver's: a function is a function, a record or a choice or an effect is a type, a variant is an enum member, a parameter is a parameter, and a name nothing resolved is a variable, which is what a reader wants to see while they are still typing it. Two decisions worth saying out loud. Punctuation carries no colour, because an editor already draws brackets and sending a type for every comma would be sending most of the file to say nothing. And a builtin is split by its first letter, which is not a guess: every type in this language starts with a capital and no value does, and the parser already decides `Int n = 3` by that rule. A file that does not check is still painted. The resolver's answers are read when there are any, because the moment a reader most wants colour is while the file is half written.
onatozmenn
enabled auto-merge (squash)
August 5, 2026 12:47
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
textDocument/semanticTokens/full, the last thing on the advertised list this server did not answer and the one an editor cannot do for itself.
The keyword/name split is the lexer's own. What a name stands for is the resolver's: function, type, enum member, parameter, or variable for a name nothing resolved.
Punctuation carries no colour. A builtin is split by its first letter, which is not a guess: every type in this language starts with a capital and the parser already decides Int n = 3 by that rule. A file that does not check is still painted.