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

Highlighting fails for string literal unions #406

Closed
spaceunifyfifty opened this issue Jul 30, 2024 · 1 comment · Fixed by #409
Closed

Highlighting fails for string literal unions #406

spaceunifyfifty opened this issue Jul 30, 2024 · 1 comment · Fixed by #409

Comments

@spaceunifyfifty
Copy link

spaceunifyfifty commented Jul 30, 2024

Commit of tree-sitter-scala you tested this on

45b5ba0

A code sample showing the error

Syntax highlighting for string literal union types fails under multiple circumstances. I first noticed this on Scastie (issue posted here), but also experience it on Zed.

Here is a screenshot of the failing cases I've found so far

image
// works!
type test1 = "a" | "b"
// fails after two elements
type test2 = "a" | "b" | "c"
// breaks from tokens on next line
type test3 = "a" | "b"
// like this comment
type test4 = "a" | "b"
type test4_ = "x" | "y"
// breaks subsequent lines as well
// fails for parameter types
def test5(x: "a" | "b") = ???
// fails for return types
def test6(): "a" | "b" = ???

Zed version: 0.142.6
Zed Scala extension version: 0.0.3

Show the error node

will add later if I have time to figure out. I am not familiar with how tree-sitters work.

What do you expect the tree to look like

No response

Where are you experiencing this error?

Zed, Scastie

@spaceunifyfifty spaceunifyfifty changed the title Syntax highlighting fails for string literal unions Highlighting fails for string literal unions Jul 30, 2024
@susliko
Copy link
Collaborator

susliko commented Aug 7, 2024

@spaceunifyfifty Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants