mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Document order-dependence of isLocal flag (#49959)
This commit is contained in:
parent
5a53e9bb5e
commit
8402d657ab
@ -344,6 +344,8 @@ namespace ts.server {
|
||||
function getDefinitionLocation(defaultProject: Project, initialLocation: DocumentPosition, isForRename: boolean): DocumentPosition | undefined {
|
||||
const infos = defaultProject.getLanguageService().getDefinitionAtPosition(initialLocation.fileName, initialLocation.pos, /*searchOtherFilesOnly*/ false, /*stopAtAlias*/ isForRename);
|
||||
const info = infos && firstOrUndefined(infos);
|
||||
// Note that the value of `isLocal` may depend on whether or not the checker has run on the containing file
|
||||
// (implying that FAR cascading behavior may depend on request order)
|
||||
return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : undefined;
|
||||
}
|
||||
|
||||
|
||||
@ -1045,7 +1045,12 @@ namespace ts {
|
||||
containerKind: ScriptElementKind;
|
||||
containerName: string;
|
||||
unverified?: boolean;
|
||||
/* @internal */ isLocal?: boolean;
|
||||
/** @internal
|
||||
* Initially, this value is determined syntactically, but it is updated by the checker to cover
|
||||
* cases like declarations that are exported in subsequent statements. As a result, the value
|
||||
* may be "incomplete" if this span has yet to be checked.
|
||||
*/
|
||||
isLocal?: boolean;
|
||||
/* @internal */ isAmbient?: boolean;
|
||||
/* @internal */ failedAliasResolution?: boolean;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user