After reading the src\services code, it seems this is the interface any host of a language service must satisfy:
//
// Public interface of the host of a language service instance.
//
export interface ILanguageServiceHost extends TypeScript.ILogger {
getCompilationSettings(): TypeScript.CompilationSettings;
getScriptCount(): number;
getScriptId(scriptIndex: number): string;
getScriptSourceText(scriptIndex: number, start: number, end: number): string;
getScriptSourceLength(scriptIndex: number): number;
getScriptIsResident(scriptIndex: number): bool;
getScriptVersion(scriptIndex: number): number;
getScriptEditRangeSinceVersion(scriptIndex: number, scriptVersion: number): TypeScript.ScriptEditRange;
}
I haven't been able to find any documentation or samples, and while some methods are self-explanatory, others are not, notably:
getScriptId()
getScriptIsResident()
getScriptVersion()
getScriptEditRangeSinceVersion()
Is the language service API ready for use? Could someone explain briefly the purpose of the methods above?