Skip to content

Conversation

@rubywwwilde
Copy link

The 'to' keyword is no longer used in Roc and was sometimes causing incorrect highlighting of identifiers containing "to" (like "todos", "into", etc).

According to the Roc community, the header style app "test" provides [main] to "./platform" is deprecated and 'to' is no longer a keyword.

This PR removes the (to) node from the syntax highlighting rules to fix the incorrect highlighting behavior.

Fixes: Variables like "todos" incorrectly highlighting "to" portion

Copy link
Author

@rubywwwilde rubywwwilde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omg, this has a bug, sorry

"module"
"package"
"import"
"provides
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the closing one??

This was my first time working with this domain. That means I could have
made some really dumb mistakes. My current approach was to copy all the
files from tree-sitter: `cp queries/*.scm
~/Projects/zed-roc/languages/roc/`.

Additionally I've moved (identifier) @string to the top, cause it was
ruining everything at the bottom. Then I added this line to color the
declarations, as it is done in nvim plugin: (value_declaration
(decl_left (identifier_pattern (identifier) @variable.parameter)))
@rubywwwilde
Copy link
Author

omg, I spent the whole hour in hyperfocus trying to understand what this is all about. it seems to be working now and it matches nvim's implementation pretty closely

image image

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 this pull request may close these issues.

1 participant