refactor(language-service): create getTypeDefinitionAtPosition stubs (#39050)
Create stubs for getTypeDefinitionAtPosition for both VE and Ivy Language Service implementations. This will prevent failed requests when it is implemented on the vscode plugin side PR Close #39050
This commit is contained in:
parent
ddc9e8e47a
commit
31e42f0947
|
@ -24,8 +24,13 @@ export function create(info: ts.server.PluginCreateInfo): ts.LanguageService {
|
||||||
return diagnostics;
|
return diagnostics;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getTypeDefinitionAtPosition(fileName: string, position: number) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...tsLS,
|
...tsLS,
|
||||||
getSemanticDiagnostics,
|
getSemanticDiagnostics,
|
||||||
|
getTypeDefinitionAtPosition,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,16 +110,20 @@ export function create(info: tss.server.PluginCreateInfo): tss.LanguageService {
|
||||||
return ngLS.getDefinitionAndBoundSpan(fileName, position);
|
return ngLS.getDefinitionAndBoundSpan(fileName, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
const proxy: tss.LanguageService = Object.assign(
|
function getTypeDefinitionAtPosition(fileName: string, position: number) {
|
||||||
|
// Not implemented in VE Language Service
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
// First clone the original TS language service
|
// First clone the original TS language service
|
||||||
{}, tsLS,
|
...tsLS,
|
||||||
// Then override the methods supported by Angular language service
|
// Then override the methods supported by Angular language service
|
||||||
{
|
|
||||||
getCompletionsAtPosition,
|
getCompletionsAtPosition,
|
||||||
getQuickInfoAtPosition,
|
getQuickInfoAtPosition,
|
||||||
getSemanticDiagnostics,
|
getSemanticDiagnostics,
|
||||||
getDefinitionAtPosition,
|
getDefinitionAtPosition,
|
||||||
getDefinitionAndBoundSpan,
|
getDefinitionAndBoundSpan,
|
||||||
});
|
getTypeDefinitionAtPosition,
|
||||||
return proxy;
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue