mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Only mark symbols found in a local symbol table
This commit is contained in:
1 parent
3d9c9206e4
commit
b40512d8a2
1 file changed
+5
-5
@@ -51,7 +51,7 @@ namespace ts {
|
||||
const compilerOptions = host.getCompilerOptions();
|
||||
const languageVersion = compilerOptions.target || ScriptTarget.ES3;
|
||||
const modulekind = getEmitModuleKind(compilerOptions);
|
||||
const noUnusedIdentifiers = compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters;
|
||||
const noUnusedIdentifiers = !!compilerOptions.noUnusedLocals || !!compilerOptions.noUnusedParameters;
|
||||
const allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ModuleKind.System;
|
||||
const strictNullChecks = compilerOptions.strictNullChecks;
|
||||
|
||||
@@ -849,6 +849,10 @@ namespace ts {
|
||||
location = location.parent;
|
||||
}
|
||||
|
||||
if (result && nameNotFoundMessage && noUnusedIdentifiers) {
|
||||
result.isReferenced = true;
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
result = getSymbol(globals, name, meaning);
|
||||
}
|
||||
@@ -899,10 +903,6 @@ namespace ts {
|
||||
error(errorLocation, Diagnostics.Identifier_0_must_be_imported_from_a_module, name);
|
||||
}
|
||||
}
|
||||
|
||||
if (result && noUnusedIdentifiers && !isInAmbientContext(location)) {
|
||||
result.isReferenced = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user