fix(language-service): ignore hover of symbols not in the TypeScript program (#17969)
Fixes: #17965
This commit is contained in:

committed by
Jason Aden

parent
cb16e9c747
commit
227dbbcfba
@ -322,7 +322,7 @@ export interface SymbolQuery {
|
||||
/**
|
||||
* Return the type symbol for the given static symbol.
|
||||
*/
|
||||
getTypeSymbol(type: StaticSymbol): Symbol;
|
||||
getTypeSymbol(type: StaticSymbol): Symbol|undefined;
|
||||
|
||||
/**
|
||||
* Return the members that are in the context of a type's template reference.
|
||||
|
@ -159,10 +159,10 @@ class TypeScriptSymbolQuery implements SymbolQuery {
|
||||
}
|
||||
}
|
||||
|
||||
getTypeSymbol(type: StaticSymbol): Symbol {
|
||||
getTypeSymbol(type: StaticSymbol): Symbol|undefined {
|
||||
const context: TypeContext = {node: this.source, program: this.program, checker: this.checker};
|
||||
const typeSymbol = findClassSymbolInContext(type, context) !;
|
||||
return new SymbolWrapper(typeSymbol, context);
|
||||
const typeSymbol = findClassSymbolInContext(type, context);
|
||||
return typeSymbol && new SymbolWrapper(typeSymbol, context);
|
||||
}
|
||||
|
||||
createSymbolTable(symbols: SymbolDeclaration[]): SymbolTable {
|
||||
|
Reference in New Issue
Block a user