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

Parsing Typescript #447

Open
yankeeinlondon opened this issue Sep 17, 2022 · 2 comments
Open

Parsing Typescript #447

yankeeinlondon opened this issue Sep 17, 2022 · 2 comments

Comments

@yankeeinlondon
Copy link

In the current environment I do understand that one can get some parsing of Typescript by stating "JavaScript" as the language but this is less than ideal. Typescript is one of the most popular languages today and it would be nice if we could get more specifics into the type system that are missing today. For instance a type in Typescript code is tagged as a variable.

I'm new to this library and still trying to fully put my head around what is what in terms of grammar but is there a way to adequately parse Typescript today or are we stuck with just the JavaScript parser?

@ipauler
Copy link

ipauler commented Sep 19, 2022

@yankeeinlondon
There's a solution
You'll need to first download Microsoft's official TypeScriptReact.tmLanguage file and save it somewhere.
Convert that .tmLanguage file to a .sublime-syntax file, using Sublime Text 3's builtin Plugin Development: Convert Syntax to .sublime-syntax command (important: only shows up when viewing .tmLanguage files)
Save the new .sublime-syntax file into e.g. testdata/Packages/TypeScript/TypeScriptReact.sublime-syntax
Run make assets.
from here

STBoyden added a commit to Authentura/codectrl-nodejs-logger that referenced this issue Nov 1, 2022
The syntax highlighter we are currently using in CodeCTRL does not have
support for TypeScript syntax, so use JavaScript highlighting until it
is available. trishume/syntect#447
@indianakernick
Copy link

I would love to see the TypeScript syntax definitions brought into syntect (so that users don't have to download and install it themselves). It is one of the most used languages out there.

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

No branches or pull requests

3 participants