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

Custom TypeScript language and language service extension for better DX #36

Open
dmisdm opened this issue Sep 17, 2021 · 2 comments
Open

Comments

@dmisdm
Copy link

dmisdm commented Sep 17, 2021

Hey there! Super into this project!

Bear in mind, i may be missing crucial bits of information to this project as i'm new to it, and what i've done may not be the most ideal.

I noticed a few quirks within TypeScript cells, such as top level awaits showing up as errors (for a few possible reasons such as requiring "module": "ESNext"), and that TypeScript doesn't know about variables shared between cells.

I've been playing around with making this work, and had a bit of sucess with shipping a new language and language service extension (cloned from the existing typescript extensions), as this allowed me to change one tiny detail:
image

which made top level awaits work (if you import something):
image

I'm completely aware that this may be a drastic change (shipping a new language) however i'm hoping that it just becomes a matter of importing and augmenting the existing extensions rather than shipping 99% of the same code...if that makes any sense?

My question is: would you accept this kind of contribution given it was designed well?

Also, some background: i'm also trying to solve the same issue for a similar side project https://dmisdm.github.io/ts-notebook/

I haven't yet thought of a cleaner way to solve these issues, and i'm not 100% a new language is the best way.
E.g. i also thought a lot could be done using a custom "typescript.tsdk" (VSCode config), similar to what @yarnpkg/pnpify does (it augments typescript/lib/tsserver.js to support loading definitions in a PnP environment), however this has it's drawbacks too.

@DonJayamanne
Copy link
Owner

would you accept this kind of contribution given it was designed well?

Absolutely yes.

My only concern is the fact that it's a custom language, however there's only one way to learn of this is a problem or not, and that's to get it in from of the users

@DonJayamanne
Copy link
Owner

Looking forward to ur PR, thanks

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

2 participants