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 TypeScript highlights #18525

Merged
merged 6 commits into from
Jan 10, 2025

Conversation

Huliiiiii
Copy link
Contributor

@Huliiiiii Huliiiiii commented Sep 30, 2024

  • Move function queries under constant queries to avoid uppercase functions highlighted as constants
  • Merge keywords and remove duplicates
  • Highlights type aliases on import
  • Highlights literal built-in types (null, undefined, true, false) as @type.builtin

Confused about case-based queries, should they be rewritten?

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 30, 2024
Comment on lines 7 to 11
((identifier) @constructor
(#match? @constructor "^[A-Z]"))

((identifier) @type
(#match? @type "^[A-Z]"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The second query always overwrites the first, can anyone explain why it's written in this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This also causes CamelCase variables to be highlighted as types.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can remove the constructor one. Thanks for catching that.

@maxdeviant maxdeviant changed the title Improve typescript highlights Improve TypeScript highlights Sep 30, 2024
Comment on lines 7 to 11
((identifier) @constructor
(#match? @constructor "^[A-Z]"))

((identifier) @type
(#match? @type "^[A-Z]"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can remove the constructor one. Thanks for catching that.

@maxdeviant
Copy link
Member

@Huliiiiii It looks like there are some merge conflicts that need to be resolved.

Once those are resolved I think this will be in a state that we can merge.

@maxdeviant maxdeviant added this pull request to the merge queue Jan 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 10, 2025
@maxdeviant maxdeviant added this pull request to the merge queue Jan 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 10, 2025
@maxdeviant maxdeviant enabled auto-merge January 10, 2025 21:44
@maxdeviant maxdeviant added this pull request to the merge queue Jan 10, 2025
Merged via the queue into zed-industries:main with commit 8bd7a04 Jan 10, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants