-
Notifications
You must be signed in to change notification settings - Fork 202
Rewrite atom-typescript to use tsserver API #1166
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
Conversation
* Remove pane from the list when it’s disposed * Add a basic compileOnSave feature
[fix error] Deprecated selector
Thanks to you I can finally use typescript :) Would it be possible to set intellisense support for files which contain a <script lang="typescript"> tag on the feature list? #1138 |
just got this after installation
is this still relevant? |
@ZuBB it just means that you have both |
@guncha thanks for your reply. thats OK. I have disabled original version already. By the way this beta works really quick and smooth. thanks a lot for you efforts 🙇 |
since issues are closed in forked repo ought to do pseudo bug report here
At /Users/vzuzyak/.atom/packages/atom-typescript-beta/dist/main/atomts.js:79 TypeError: Cannot read property 'executeGetErr' of undefined
6x -0:59.1.0 vim-mode-plus:move-to-next-word (input.hidden-input)
atom-beautify 0.29.17
|
Does not tsserver support quickfixes through microsoft/TypeScript#10185? |
@jimmytheneutrino no reason it couldn't. The Typescript team has added quite a few quickfixes in the last two Typescript versions so this would be a worthwhile feature. |
@guncha Just a heads up. You have full executive authority on atom-typescript and are now an owner under TypeStrong. Make |
Thanks @basarat! Any ideas how to smoothly transition to the version in this branch? |
Rename |
I got new error with beta version https://gist.github.com/ZuBB/d35eb7530a142ce3aaf3fc62abc8268e |
Thanks @ZuBB, it'd be great if you could open an issue in this repo and I'll tag it with |
add return-to-declaration functionality on the tsserver branch
Wohooo 🌹 Looking forward to installing it ❤🤗 |
Awesome 😊 I expect to wake up to a million complaints, but we'll get through it.. |
Wow! Amazing work. =) |
What is this?
This is a rewrite of the
atom-typescript
package to use a different API when talking to Typescript, but with a lot less features compared to the current implementation.Why would you do such a thing?
Current implementation relies on Typescript's internals, including undocumented APIs, and does a lot of work to match Typescript's behavior. Unfortunately, Typescript's a moving target and this setup is harder to maintain which no one is doing currently.
For example, if Typescript adds a new
tsconfig.json
option we have to release a new version with updated validation rules. Usually that's trivial, but sometimes it isn't. Supporting something likeextends
would require a non-trivial amount of work.More importantly, there are a lot of open issues where the behavior of
atom-typescript
doesn't match that of runningtsc
from the command line (closes #1106, closes #1105, closes #1054, closes #1055). There are a few different reasons for those, but they all are caused byatom-typescript
trying to replicate what the compiler does and the compiler changing what it does over time.Fortunately, there's a way to let Typescript handle as many details as possible by using their tsserver API. Unfortunately, this requires rewriting most of the functionality of this plugin.
Pros for this approach
tsconfig.json
files, etc, which makes the plugin more reliable and eases the maintenance burden.typescript
installation comes with atsserver
executable, we can use the exact Typescript version from thenode_modules
directory. This remove another cause whyatom-typescript
and running compiler on the command line might disagree about something. This is also more future proof since you don't need to updateatom-typescript
with every new version.Cons
Here's a list of things I've implemented so far and others that I haven't:
tsconfig.json
says otherwise)How do I use this?
Simply install
atom-typescript-beta
package (https://atom.io/packages/atom-typescript-beta). Make sureatom-typescript
is disabled as it will not work when both are enabled.Eventually I'd like to merge this into master, but only if there's enough support from the community so use your 👍 and 👎 on this issue to let me know what you think.
Some GIFs are in order
I've basically smushed all the information into the bottom right of the status bar:

Build command:

Symbol highlighting in the same file:

Closes #1134