-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add editor configurable filename-based ATA #40952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
187576c
52bc8b0
4113e91
45ae636
d3a2d41
67fda70
554a98f
48eccaa
a187137
aa46e02
b6ee490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1732,6 +1732,8 @@ namespace ts.server { | |
|
|
||
| private _isJsInferredProject = false; | ||
|
|
||
| private typeAcquisition: TypeAcquisition | undefined; | ||
|
|
||
| toggleJsInferredProject(isJsInferredProject: boolean) { | ||
| if (isJsInferredProject !== this._isJsInferredProject) { | ||
| this._isJsInferredProject = isJsInferredProject; | ||
|
|
@@ -1770,7 +1772,8 @@ namespace ts.server { | |
| watchOptions: WatchOptions | undefined, | ||
| projectRootPath: NormalizedPath | undefined, | ||
| currentDirectory: string | undefined, | ||
| pluginConfigOverrides: ESMap<string, any> | undefined) { | ||
| pluginConfigOverrides: ESMap<string, any> | undefined, | ||
| typeAcquisition: TypeAcquisition | undefined) { | ||
| super(InferredProject.newName(), | ||
| ProjectKind.Inferred, | ||
| projectService, | ||
|
|
@@ -1783,6 +1786,7 @@ namespace ts.server { | |
| watchOptions, | ||
| projectService.host, | ||
| currentDirectory); | ||
| this.typeAcquisition = typeAcquisition; | ||
| this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); | ||
| if (!projectRootPath && !projectService.useSingleInferredProject) { | ||
| this.canonicalCurrentDirectory = projectService.toCanonicalFileName(this.currentDirectory); | ||
|
|
@@ -1827,11 +1831,16 @@ namespace ts.server { | |
| super.close(); | ||
| } | ||
|
|
||
| setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void { | ||
| this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); | ||
| } | ||
|
|
||
| getTypeAcquisition(): TypeAcquisition { | ||
| return { | ||
| return this.typeAcquisition || { | ||
| enable: allRootFilesAreJsOrDts(this), | ||
| include: ts.emptyArray, | ||
| exclude: ts.emptyArray | ||
| exclude: ts.emptyArray, | ||
| disableFilenameBasedTypeAcquisition: false | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think you need to set this since this is optional |
||
| }; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1333,7 +1333,7 @@ namespace ts.server.protocol { | |
| * For external projects, some of the project settings are sent together with | ||
| * compiler settings. | ||
| */ | ||
| export type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions; | ||
| export type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin & WatchOptions & TypeAcquisition; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can create different type instead you should create a type |
||
|
|
||
| /** | ||
| * Contains information about current project version | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if if this.typeAcquisition and set method should be moved to
Projectsince 3 project types use the same method.