-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
TS Server #2041
Conversation
Conflicts: Jakefile
if (info.defaultProject.getSourceFile(r)) { | ||
// remove project rooted at r | ||
this.inferredProjects = | ||
copyListRemovingItem(r.defaultProject, this.inferredProjects); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get this onto the same line as the =
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awkward and a probably somewhat unnecessary.
the end of the deleted Range (inclusive). DeleteLen was not always accurate because editors normalize \r\n to \n in some cases, affecting the length of ranges. In Diagnostic response items, changed len field to end to address the same range length issue. Flattened MessageDiagnosticChains in diagnostic message text, since clients expect string there. Renamed ts.server.protocol to simply protocol in session.ts and client.ts since module name prefix is clear. Based on protocol feedback: Changed LineCol to Location. Changed CodeLocation interface name prefix to FileLocation. Changed DiagEvent to DiagnosticEvent. Removed anonymous types.
"completionEntryDetails". This mirrors the function of the LS API and increases performance of completion in large projects.
I reviewed the TSServer code today as it exists in https://github.com/Microsoft/TypeScript/tree/master/src/server I think its really nicely done in that it takes the burden of watching files + efficient snapshoting off of editor package authors. The limitations for us is that it does not (and cannot easily using stdout) expose I am okay with using TSServer as a reference implementation and copying all the good stuff over. But just wanted to leave this feedback about my reasons for doing so (and potentially other package authors might end up doing the same thing). Thanks again for the initiative ❤️ ref : Based on TypeStrong/atom-typescript#91 /cc @csnover |
The basic LanguageService interface puts some requirements on the "host", such as an implementation of a ScriptSnapshot system to support incremental parsing, managing contexts, monitoring files on disk, scheduling diagnostic queries, maintaining line map for line/column for positions for files, etc.. Every editor plugin is required to implement the expected host functionality, possibly in different languages.
This change exposes a new interface to the Services layer (ts server), through a JSON-based communication protocol. Behind the protocol, the server supports all the common host functionality,:
The server is mainly available as an IO process that a client would create in a separate process and communicates with it over stdin/stdout.
The change also adds a JS client implementation as a reference implementation to a client, and also used for tests.
The protocol definitions are all in protocol.d.ts.
Note: Reviewing the final change is probably easier.