Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
make host implement getScriptKind, #203
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed May 4, 2017
1 parent a210d77 commit 9b5c885
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ export class TypeScriptWorker implements ts.LanguageServiceHost {
};
}

getScriptKind?(fileName: string): ts.ScriptKind {
const suffix = fileName.substr(fileName.lastIndexOf('.') + 1);
switch (suffix) {
case 'ts': return ts.ScriptKind.TS;
case 'tsx': return ts.ScriptKind.TSX;
case 'js': return ts.ScriptKind.JS;
case 'jsx': return ts.ScriptKind.JSX;
default: return this.getCompilationSettings().allowJs
? ts.ScriptKind.JS
: ts.ScriptKind.TS;
}
}

getCurrentDirectory(): string {
return '';
}
Expand Down

0 comments on commit 9b5c885

Please sign in to comment.