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

Improve highlighting of identifiers #286

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tobil4sk
Copy link
Contributor

This allows customisation for how variable/member identifiers are highlighted and links them to Identifier by default.

Vim docs: Identifier any variable name.

@tobil4sk tobil4sk force-pushed the fix/identifier-highlighting branch from 5067c68 to fa2700b Compare August 16, 2024 19:54
@@ -41,6 +41,9 @@ runtime syntax/ts-common/cluster.vim
runtime syntax/ts-common/function.vim
runtime syntax/ts-common/decorator.vim

hi def link typescriptIdentifierName Identifier
hi def link typescriptProp Identifier

Choose a reason for hiding this comment

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

should Prop be linked to Identifier? It will make both option and field in expression likeoption.field highlighted as identifiers.

Also, can you paste a screenshot for the change? thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vim only has Identifier, so it doesn't distinguish between variables and fields. Currently, option and field already look the same since both are unlinked.

@tobil4sk
Copy link
Contributor Author

tobil4sk commented Aug 16, 2024

Neovim default theme:
Before:
image

After:
image

Vim colorscheme in neovim:
Before:
image

After:
image

@HerringtonDarkholme
Copy link
Owner

I noticed on NeoVim the original coloring is more diverse and differentiated. The updated syntax highlighting is not too clear. Say, the option.field(arg) is all green color, but the original highlight has two colors.

@tobil4sk
Copy link
Contributor Author

I noticed on NeoVim the original coloring is more diverse and differentiated

I can change it to unlink typescriptProp if this is preferred:

Vim theme in neovim:
image

Neovim default theme:
image

As long as typescriptProp and typescriptIdentifierName are not set as transparent, then this gives more control for custom themes to differentiate them.

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