Skip to content

Commit

Permalink
fix: language server crash with low TS version
Browse files Browse the repository at this point in the history
close #1242
  • Loading branch information
johnsoncodehk committed Apr 29, 2022
1 parent 0fe0f17 commit 981061f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -19,7 +19,7 @@ export function register(
const fileName = shared.uriToFsPath(document.uri);
const start = document.offsetAt(range.start);
const end = document.offsetAt(range.end);
const inlayHints = languageService.provideInlayHints(fileName, { start, length: end - start }, preferences);
const inlayHints = 'provideInlayHints' in languageService ? languageService.provideInlayHints(fileName, { start, length: end - start }, preferences) : [];

return inlayHints.map(inlayHint => {
const result = vscode.InlayHint.create(
Expand Down

0 comments on commit 981061f

Please sign in to comment.