mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Use compilation options to get extensions to remove to get module name
This commit is contained in:
@@ -77,13 +77,13 @@ namespace ts {
|
||||
IsContainerWithLocals = IsContainer | HasLocals
|
||||
}
|
||||
|
||||
export function bindSourceFile(file: SourceFile) {
|
||||
export function bindSourceFile(file: SourceFile, compilerOptions: CompilerOptions) {
|
||||
let start = new Date().getTime();
|
||||
bindSourceFileWorker(file);
|
||||
bindSourceFileWorker(file, compilerOptions);
|
||||
bindTime += new Date().getTime() - start;
|
||||
}
|
||||
|
||||
function bindSourceFileWorker(file: SourceFile) {
|
||||
function bindSourceFileWorker(file: SourceFile, compilerOptions: CompilerOptions) {
|
||||
let parent: Node;
|
||||
let container: Node;
|
||||
let blockScopeContainer: Node;
|
||||
@@ -941,7 +941,7 @@ namespace ts {
|
||||
function bindSourceFileIfExternalModule() {
|
||||
setExportContextFlag(file);
|
||||
if (isExternalModule(file)) {
|
||||
bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName)}"`);
|
||||
bindAnonymousDeclaration(file, SymbolFlags.ValueModule, `"${removeFileExtension(file.fileName, getSupportedExtensions(compilerOptions))}"`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14833,7 +14833,7 @@ namespace ts {
|
||||
function initializeTypeChecker() {
|
||||
// Bind all source files and propagate errors
|
||||
forEach(host.getSourceFiles(), file => {
|
||||
bindSourceFile(file);
|
||||
bindSourceFile(file, compilerOptions);
|
||||
});
|
||||
|
||||
// Initialize global symbol table
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/* @internal */
|
||||
namespace ts.NavigationBar {
|
||||
export function getNavigationBarItems(sourceFile: SourceFile): ts.NavigationBarItem[] {
|
||||
export function getNavigationBarItems(sourceFile: SourceFile, compilerOptions: CompilerOptions): ts.NavigationBarItem[] {
|
||||
// If the source file has any child items, then it included in the tree
|
||||
// and takes lexical ownership of all other top-level items.
|
||||
let hasGlobalNode = false;
|
||||
@@ -442,7 +442,7 @@ namespace ts.NavigationBar {
|
||||
|
||||
hasGlobalNode = true;
|
||||
let rootName = isExternalModule(node)
|
||||
? "\"" + escapeString(getBaseFileName(removeFileExtension(normalizePath(node.fileName)))) + "\""
|
||||
? "\"" + escapeString(getBaseFileName(removeFileExtension(normalizePath(node.fileName), getSupportedExtensions(compilerOptions)))) + "\""
|
||||
: "<global>"
|
||||
|
||||
return getNavigationBarItem(rootName,
|
||||
|
||||
@@ -6263,7 +6263,7 @@ namespace ts {
|
||||
function getNavigationBarItems(fileName: string): NavigationBarItem[] {
|
||||
let sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
|
||||
|
||||
return NavigationBar.getNavigationBarItems(sourceFile);
|
||||
return NavigationBar.getNavigationBarItems(sourceFile, host.getCompilationSettings());
|
||||
}
|
||||
|
||||
function getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] {
|
||||
|
||||
Reference in New Issue
Block a user