Skip to content

Commit 8e9cd76

Browse files
dependabot[bot]github-actions[bot]buke
authored
deps(deps): bump microsoft/typescript-go from 18bbf2f to dc6ce07 (#36)
* deps(deps): bump microsoft/typescript-go from `18bbf2f` to `dc6ce07` Bumps [microsoft/typescript-go](https://github.com/microsoft/typescript-go) from `18bbf2f` to `dc6ce07`. - [Commits](microsoft/typescript-go@18bbf2f...dc6ce07) --- updated-dependencies: - dependency-name: microsoft/typescript-go dependency-version: dc6ce076f4d0813005b87b3fb7e976b627c47a2c dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * chore(sync): mirror internal packages into pkg/ (auto) (#37) Co-authored-by: buke <1013738+buke@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: buke <1013738+buke@users.noreply.github.com>
1 parent 4d92bfa commit 8e9cd76

File tree

86 files changed

+3897
-530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3897
-530
lines changed

microsoft/typescript-go

Submodule typescript-go updated 87 files

pkg/checker/checker.go

Lines changed: 142 additions & 167 deletions
Large diffs are not rendered by default.

pkg/checker/types.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,10 @@ type DeferredSymbolLinks struct {
146146
// Links for alias symbols
147147

148148
type AliasSymbolLinks struct {
149-
immediateTarget *ast.Symbol // Immediate target of an alias. May be another alias. Do not access directly, use `checker.getImmediateAliasedSymbol` instead.
150-
aliasTarget *ast.Symbol // Resolved (non-alias) target of an alias
151-
referenced bool // True if alias symbol has been referenced as a value that can be emitted
152-
typeOnlyDeclarationResolved bool // True when typeOnlyDeclaration resolution in process
153-
typeOnlyDeclaration *ast.Node // First resolved alias declaration that makes the symbol only usable in type constructs
154-
typeOnlyExportStarName string // Set to the name of the symbol re-exported by an 'export type *' declaration, when different from the symbol name
149+
immediateTarget *ast.Symbol // Immediate target of an alias. May be another alias. Do not access directly, use `checker.getImmediateAliasedSymbol` instead.
150+
aliasTarget *ast.Symbol // Resolved (non-alias) target of an alias
151+
referenced bool // True if alias symbol has been referenced as a value that can be emitted
152+
typeOnlyDeclaration *ast.Node // First resolved alias declaration that makes the symbol only usable in type constructs
155153
}
156154

157155
// Links for module symbols

pkg/compiler/fileloader.go

Lines changed: 9 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -129,128 +129,12 @@ func processAllProgramFiles(
129129
}
130130

131131
loader.filesParser.parse(&loader, loader.rootTasks)
132+
132133
// Clear out loader and host to ensure its not used post program creation
133134
loader.projectReferenceFileMapper.loader = nil
134135
loader.projectReferenceFileMapper.host = nil
135136

136-
totalFileCount := int(loader.totalFileCount.Load())
137-
libFileCount := int(loader.libFileCount.Load())
138-
139-
var missingFiles []string
140-
files := make([]*ast.SourceFile, 0, totalFileCount-libFileCount)
141-
libFiles := make([]*ast.SourceFile, 0, totalFileCount) // totalFileCount here since we append files to it later to construct the final list
142-
143-
filesByPath := make(map[tspath.Path]*ast.SourceFile, totalFileCount)
144-
loader.includeProcessor.fileIncludeReasons = make(map[tspath.Path][]*FileIncludeReason, totalFileCount)
145-
var outputFileToProjectReferenceSource map[tspath.Path]string
146-
if !opts.canUseProjectReferenceSource() {
147-
outputFileToProjectReferenceSource = make(map[tspath.Path]string, totalFileCount)
148-
}
149-
resolvedModules := make(map[tspath.Path]module.ModeAwareCache[*module.ResolvedModule], totalFileCount+1)
150-
typeResolutionsInFile := make(map[tspath.Path]module.ModeAwareCache[*module.ResolvedTypeReferenceDirective], totalFileCount)
151-
sourceFileMetaDatas := make(map[tspath.Path]ast.SourceFileMetaData, totalFileCount)
152-
var jsxRuntimeImportSpecifiers map[tspath.Path]*jsxRuntimeImportSpecifier
153-
var importHelpersImportSpecifiers map[tspath.Path]*ast.Node
154-
var sourceFilesFoundSearchingNodeModules collections.Set[tspath.Path]
155-
libFilesMap := make(map[tspath.Path]*LibFile, libFileCount)
156-
157-
loader.filesParser.collect(&loader, loader.rootTasks, func(task *parseTask) {
158-
if task.redirectedParseTask != nil {
159-
if !opts.canUseProjectReferenceSource() {
160-
outputFileToProjectReferenceSource[task.redirectedParseTask.path] = task.FileName()
161-
}
162-
return
163-
}
164-
165-
if task.isForAutomaticTypeDirective {
166-
typeResolutionsInFile[task.path] = task.typeResolutionsInFile
167-
return
168-
}
169-
file := task.file
170-
path := task.path
171-
if file == nil {
172-
// !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker
173-
missingFiles = append(missingFiles, task.normalizedFilePath)
174-
return
175-
}
176-
177-
// !!! sheetal todo porting file case errors
178-
// if _, ok := filesByPath[path]; ok {
179-
// Check if it differs only in drive letters its ok to ignore that error:
180-
// const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory);
181-
// const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory);
182-
// if (checkedAbsolutePath !== inputAbsolutePath) {
183-
// reportFileNamesDifferOnlyInCasingError(fileName, file, reason);
184-
// }
185-
// } else if loader.comparePathsOptions.UseCaseSensitiveFileNames {
186-
// pathIgnoreCase := tspath.ToPath(file.FileName(), loader.comparePathsOptions.CurrentDirectory, false)
187-
// // for case-sensitsive file systems check if we've already seen some file with similar filename ignoring case
188-
// if _, ok := filesByNameIgnoreCase[pathIgnoreCase]; ok {
189-
// reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason);
190-
// } else {
191-
// filesByNameIgnoreCase[pathIgnoreCase] = file
192-
// }
193-
// }
194-
195-
if task.libFile != nil {
196-
libFiles = append(libFiles, file)
197-
libFilesMap[path] = task.libFile
198-
} else {
199-
files = append(files, file)
200-
}
201-
filesByPath[path] = file
202-
resolvedModules[path] = task.resolutionsInFile
203-
typeResolutionsInFile[path] = task.typeResolutionsInFile
204-
sourceFileMetaDatas[path] = task.metadata
205-
206-
if task.jsxRuntimeImportSpecifier != nil {
207-
if jsxRuntimeImportSpecifiers == nil {
208-
jsxRuntimeImportSpecifiers = make(map[tspath.Path]*jsxRuntimeImportSpecifier, totalFileCount)
209-
}
210-
jsxRuntimeImportSpecifiers[path] = task.jsxRuntimeImportSpecifier
211-
}
212-
if task.importHelpersImportSpecifier != nil {
213-
if importHelpersImportSpecifiers == nil {
214-
importHelpersImportSpecifiers = make(map[tspath.Path]*ast.Node, totalFileCount)
215-
}
216-
importHelpersImportSpecifiers[path] = task.importHelpersImportSpecifier
217-
}
218-
if task.fromExternalLibrary {
219-
sourceFilesFoundSearchingNodeModules.Add(path)
220-
}
221-
})
222-
loader.sortLibs(libFiles)
223-
224-
allFiles := append(libFiles, files...)
225-
226-
keys := slices.Collect(loader.pathForLibFileResolutions.Keys())
227-
slices.Sort(keys)
228-
for _, key := range keys {
229-
value, _ := loader.pathForLibFileResolutions.Load(key)
230-
resolvedModules[key] = module.ModeAwareCache[*module.ResolvedModule]{
231-
module.ModeAwareCacheKey{Name: value.libraryName, Mode: core.ModuleKindCommonJS}: value.resolution,
232-
}
233-
for _, trace := range value.trace {
234-
opts.Host.Trace(trace.Message, trace.Args...)
235-
}
236-
}
237-
238-
return processedFiles{
239-
resolver: loader.resolver,
240-
files: allFiles,
241-
filesByPath: filesByPath,
242-
projectReferenceFileMapper: loader.projectReferenceFileMapper,
243-
resolvedModules: resolvedModules,
244-
typeResolutionsInFile: typeResolutionsInFile,
245-
sourceFileMetaDatas: sourceFileMetaDatas,
246-
jsxRuntimeImportSpecifiers: jsxRuntimeImportSpecifiers,
247-
importHelpersImportSpecifiers: importHelpersImportSpecifiers,
248-
sourceFilesFoundSearchingNodeModules: sourceFilesFoundSearchingNodeModules,
249-
libFiles: libFilesMap,
250-
missingFiles: missingFiles,
251-
includeProcessor: loader.includeProcessor,
252-
outputFileToProjectReferenceSource: outputFileToProjectReferenceSource,
253-
}
137+
return loader.filesParser.getProcessedFiles(&loader)
254138
}
255139

256140
func (p *fileLoader) toPath(file string) tspath.Path {
@@ -466,11 +350,10 @@ func (p *fileLoader) resolveTypeReferenceDirectives(t *parseTask) {
466350

467351
if resolved.IsResolved() {
468352
t.addSubTask(resolvedRef{
469-
fileName: resolved.ResolvedFileName,
470-
increaseDepth: resolved.IsExternalLibraryImport,
471-
elideOnDepth: false,
472-
isFromExternalLibrary: resolved.IsExternalLibraryImport,
473-
includeReason: includeReason,
353+
fileName: resolved.ResolvedFileName,
354+
increaseDepth: resolved.IsExternalLibraryImport,
355+
elideOnDepth: false,
356+
includeReason: includeReason,
474357
}, nil)
475358
} else {
476359
p.includeProcessor.addProcessingDiagnostic(&processingDiagnostic{
@@ -566,10 +449,9 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(t *parseTask) {
566449

567450
if shouldAddFile {
568451
t.addSubTask(resolvedRef{
569-
fileName: resolvedFileName,
570-
increaseDepth: resolvedModule.IsExternalLibraryImport,
571-
elideOnDepth: isJsFileFromNodeModules,
572-
isFromExternalLibrary: resolvedModule.IsExternalLibraryImport,
452+
fileName: resolvedFileName,
453+
increaseDepth: resolvedModule.IsExternalLibraryImport,
454+
elideOnDepth: isJsFileFromNodeModules,
573455
includeReason: &FileIncludeReason{
574456
kind: fileIncludeKindImport,
575457
data: &referencedFileData{

0 commit comments

Comments
 (0)