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

Inherit javascript/typescript from common 'ecma' queries #3301

Merged

Conversation

the-mikedavis
Copy link
Member

@the-mikedavis the-mikedavis commented Aug 2, 2022

Looks like #3280 inadvertently ended up breaking typescript highlights because of typescript's ; inherits: javascript line. Here I've replaced that ; inherits javascript with as much of the javascript highlights as the query analysis will accept

This should fix typescript and tsx query analysis (which panics on open).

EricCrosson added a commit to EricCrosson/dotfiles that referenced this pull request Aug 2, 2022
…s/helix-aa4394c"

This reverts commit 34c977b, reversing
changes made to 651b239.

Need to wait until helix-editor/helix#3301 lands
to fix TypeScript syntax highlighting.
Copy link
Contributor

@EricCrosson EricCrosson left a comment

Choose a reason for hiding this comment

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

Yep, I'm hitting this on my side too. Quick on the draw as usual, @the-mikedavis ! Many thanks 🙇

@ChrHorn
Copy link
Contributor

ChrHorn commented Aug 2, 2022

Ah, now I understand why they did it in that way at the nvim-tresitter repo.

Both javascript and typescript inherit from ecma to avoid code duplication and prevent this issue.

Should we do the same?

@the-mikedavis
Copy link
Member Author

Yeah good call, let's keep sharing as much as we can under ecma 👍

JavaScript queries now contain a few lines that prevent them from
being used whole-sale in typescript with `; inherits: javascript`.
Here we follow nvim-treesitter's way of using a fake 'ecma' language
as a common base for JavaScript and TypeScript to share as much as
we can.
@the-mikedavis the-mikedavis force-pushed the md-fix-typescript-highlights branch from 9d19c03 to 8c0fb16 Compare August 2, 2022 19:14
@the-mikedavis the-mikedavis changed the title Remove impossible patterns from typescript highlights Inherit javascript/typescript from common 'ecma' queries Aug 2, 2022
@archseer archseer merged commit 08b442f into helix-editor:master Aug 3, 2022
@the-mikedavis the-mikedavis deleted the md-fix-typescript-highlights branch August 3, 2022 11:22
thomasskk pushed a commit to thomasskk/helix that referenced this pull request Sep 9, 2022
…r#3301)

JavaScript queries now contain a few lines that prevent them from
being used whole-sale in typescript with `; inherits: javascript`.
Here we follow nvim-treesitter's way of using a fake 'ecma' language
as a common base for JavaScript and TypeScript to share as much as
we can.
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.

4 participants