Reputation: 249696
Can language service for the 'release 1.3' typescript branch be used as a drop-in replacement in the current Visual Studio plugin? I would like to try out the 1.3 compiler and would like to have Visual Studio use the new language service, is this possible? I tried to copy the typescriptServies.js into the TS language service plugin, but this makes VS lose all completion for TS.
Upvotes: 0
Views: 314
Reputation: 46
The API is different than before, so that would not be impossible.
However the opensource editor called CATS right now has support for TypeScript 1.3 in the latest unstable release. You can download that from here:
https://github.com/jbaron/cats/releases
Some of the new features you could try out then are (all part of the latest TS master branch):
BTW I'm one of the developers of CATS. So although not too much effort migrating from 1.0.1 to 1.3, it was still for sure not a drop-in replacement. Also the current master branch still has a few methods that throw not-yet-implemented exceptions, so some special precautions are required to avoid them.
Upvotes: 3
Reputation: 14509
I don't think that will work. I believe VS uses the LanguageService interface found here: services.ts 1.3 for the 1.3 version. If you compare it to the 1.1 version of the LanguageService the interface itself is mostly the same (getTypeAtPosition is gone and replaced by getQuickInfoAtPosition and so on) but other interfaces changed too (see below for the CompletionEntryDetails interface).
I tried replacing it myself and for example renames won't work either ("Unknown type at caret position" or something).
//1.1
export interface CompletionEntryDetails {
name: string;
kind: string; // see ScriptElementKind
kindModifiers: string; // see ScriptElementKindModifier, comma separated
type: string;
fullSymbolName: string;
docComment: string;
}
//1.3
export interface CompletionEntryDetails {
name: string;
kind: string; // see ScriptElementKind
kindModifiers: string; // see ScriptElementKindModifier, comma separated
displayParts: SymbolDisplayPart[];
documentation: SymbolDisplayPart[];
}
Upvotes: 0