refactor: allow compilation with TypeScript 2.5 (#19966)
A small number of types need to be adjusted. The changes seem to be backwards compatible with TS 2.4. PR Close #19966
This commit is contained in:

committed by
Matias Niemelä

parent
7553ce9dfe
commit
005a78bd83
@ -179,7 +179,13 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
|
||||
}
|
||||
|
||||
function completionToEntry(c: Completion): ts.CompletionEntry {
|
||||
return {kind: c.kind, name: c.name, sortText: c.sort, kindModifiers: ''};
|
||||
return {
|
||||
// TODO: remove any and fix type error.
|
||||
kind: c.kind as any,
|
||||
name: c.name,
|
||||
sortText: c.sort,
|
||||
kindModifiers: ''
|
||||
};
|
||||
}
|
||||
|
||||
function diagnosticToDiagnostic(d: Diagnostic, file: ts.SourceFile): ts.Diagnostic {
|
||||
@ -294,9 +300,10 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
|
||||
fileName: loc.fileName,
|
||||
textSpan: {start: loc.span.start, length: loc.span.end - loc.span.start},
|
||||
name: '',
|
||||
kind: 'definition',
|
||||
// TODO: remove any and fix type error.
|
||||
kind: 'definition' as any,
|
||||
containerName: loc.fileName,
|
||||
containerKind: 'file'
|
||||
containerKind: 'file' as any,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user