Skip to content

feature: Add support for into modifier#304

Merged
tgodzik merged 1 commit into
mainfrom
add-into
Jun 11, 2026
Merged

feature: Add support for into modifier#304
tgodzik merged 1 commit into
mainfrom
add-into

Conversation

@tgodzik

@tgodzik tgodzik commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Comment thread src/typescript/Scala.tmLanguage.ts Outdated
name: 'storage.modifier.other'
},
{
match: '(?<=^|\\s)\\b(into)\\b(?=[a-z\\s]*\\b(type|class|trait|enum)\\b)',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider adding it to the list above with transparent, infix, etc. Before a def, it's still considered as the keyword, but it's invalid there. Same as open for example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ach right, I just figured we shouldn't show soft keywords as keywords in invalid scenarios.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

but make sense to follow the same rules as before

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ach right, I just figured we shouldn't show soft keywords as keywords in invalid scenarios.

Yes, we should, actually. If they are in a position where they are treated as keywords, they should be shown as keywords. Whether it's valid in the specific context is not a highlighter concern, it's a parser/checker concern.

It would be more disturbing to see into displayed as regular identifier, but then have the compiler tell you "values cannot be into" (as it does).

@tgodzik tgodzik merged commit bc6402b into main Jun 11, 2026
3 checks passed
@tgodzik tgodzik deleted the add-into branch June 11, 2026 10:55
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.

2 participants