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.
Resolves #24
As #30 seems to be stale, I thought it would be worth raising a small PR focused solely on closing #24, as it's a feature I'd quite like as I learn Gleam.
The PR adds a
#discards
pattern to the syntax that matches any word starting with an underscore, or isolated underscore(s). From brief investigation,comment.unused.gleam
seems to be the most idiomatic/consistent scope for this pattern. As mentioned in gleam-lang/gleam.vim#6, Elixir highlights discards as comments, and vscode-elixir-ls uses a similarcomment.unused.elixir
scope. This tends to work pretty well with any theme that doesn't use outlandish comment colouring.Below is an example of the changes with as many edge cases as I could think of (with limited knowledge of the language) - the non-decimal number highlighting will be fixed with my other PR (#78). I noticed that gleam-lang/gleam.vim#7 was having some trouble with generic arguments, so I've included an example of that working. Perhaps someone could try translating my regex for use with the Vim plugin if the functionality is still desired.