-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Handle config file change and default project management #58486
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
Conversation
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
@@ -663,6 +663,24 @@ Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /us | |||
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/myproject/folder/tsconfig.json WatchType: Type roots | |||
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/myproject/folder/tsconfig.json WatchType: Type roots | |||
Info seq [hh:mm:ss:mss] `remove Project:: | |||
Info seq [hh:mm:ss:mss] Project '/user/username/projects/myproject/tsconfig.json' (Configured) |
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.
This is exactly what happens when you open commonFile2 when it has tsconfig next to it that doesn't contain that file. This will be fixed to look for this project in #57196 but this makes the behavior consistent and not confuse when file belongs to right project or not .
3f75f76
to
3037e55
Compare
@@ -306,22 +306,21 @@ ScriptInfos:: | |||
Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /a/b/projects/project/tsconfig.json 0:: WatchInfo: /a/b/projects/project/tsconfig.json 2000 undefined Project: /a/b/projects/project/tsconfig.json WatchType: Config file | |||
Info seq [hh:mm:ss:mss] Scheduled: /a/b/projects/project/tsconfig.json | |||
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /a/b/projects/project/src/index.ts ProjectRootPath: /a/b/projects/proj:: Result: /a/b/projects/project/tsconfig.json | |||
Info seq [hh:mm:ss:mss] Scheduled: /a/b/projects/project/tsconfig.json, Cancelled earlier one |
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.
This doesnt reschedule update for project if its already scheduled through set of updated projects
@@ -495,20 +495,21 @@ ScriptInfos:: | |||
|
|||
Info seq [hh:mm:ss:mss] FileWatcher:: Triggered with /a/b/tsconfig.json 1:: WatchInfo: /a/b/tsconfig.json 2000 undefined Project: /a/b/tsconfig.json WatchType: Config file | |||
Info seq [hh:mm:ss:mss] Scheduled: /a/b/tsconfig.json | |||
Info seq [hh:mm:ss:mss] getConfigFileNameForFile:: File: /a/b/src/file1.ts ProjectRootPath: undefined:: Result: /a/b/tsconfig.json |
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.
Earlier we use to skip if file was not part of inferred project, but change in configFile can have impact on whats the default project, so we upate the default config File Name for this file in cache and make sure that the project is present. Only if its new we schedule update otherwise the project doesnt need to be updated.
This is everything from #57196 except there is no change in functionality for finding default project. So that we can get this for 5.5 but behavior change for 5.6
This change includes:
tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo
finds, creates, or reloads the default project and ancestor tree (for find all project)tryFindDefaultConfiguredProjectForOpenScriptInfo
finds, creates or reloads default project for the open file