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

LSP: Hexadecimal and Binary literals don't get highlighted if used with underscore #71

Closed
PastMoments opened this issue Apr 13, 2024 · 2 comments · Fixed by #78
Closed
Labels
bug Something isn't working

Comments

@PastMoments
Copy link

PastMoments commented Apr 13, 2024

Using gleam v1.0.0, with VSCode. Wasn't sure whether to put it here or in the extension repo, so I just put it here.

image

let _ = 123
let _ = 1_232_312
let _ = 0xFF
let _ = 0xFF_FF
let _ = 0b101101
let _ = 0b101_101

This compiles and runs just fine as expected, but the LSP doesn't seem to recognize the hex and binary with underscores as numeric literals and won't highlight them.

Note that unlike regular numbers, I don't want for these to be automatically formatted (the way normal integers are), as there's no clear way of determining where the separation is supposed to be. I'm currently using these underscores extensively in bitarrays to improve readability of magic bytes in file formats. This issue is just about the highlighting.

@PastMoments PastMoments added the bug Something isn't working label Apr 13, 2024
@lpil
Copy link
Member

lpil commented Apr 15, 2024

Hello! The language server doesn't provide syntax highlighting so you'll need to open this in the repo for whatever Gleam syntax highlighter you are using.

edit: I'll move this to the vscode repo!

@lpil lpil closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
@lpil lpil reopened this Apr 15, 2024
@lpil lpil transferred this issue from gleam-lang/gleam Apr 15, 2024
@smercer10
Copy link
Contributor

Will make a quick PR to resolve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants