Fix the issue where modifying extraFileExtensions through ProjectService.setHostConfiguration in the plugin has no effect.#61303
Fix the issue where modifying extraFileExtensions through ProjectService.setHostConfiguration in the plugin has no effect.#61303mlgq wants to merge 1 commit intomicrosoft:mainfrom mlgq:main
extraFileExtensions through ProjectService.setHostConfiguration in the plugin has no effect.#61303Conversation
src/server/editorServices.ts
Outdated
| this.watchWildcards(configFilename, configFileExistenceInfo, project); | ||
| } | ||
| project.enablePluginsWithOptions(compilerOptions); | ||
| const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles(ProgramUpdateLevel.Full)); |
There was a problem hiding this comment.
This move doesn't seem correct. Plugins can and do modify the results of getExternalFiles -- that API exists in the first place to support plugins.
There was a problem hiding this comment.
You are right. I think we can add an attribute to Project to determine whether a plugin has modified extraFileExtensions, and use this to ensure that only the innermost recursive call to updateRootAndOptionsOfNonInferredProject is made.
There was a problem hiding this comment.
Hi @RyanCavanaugh ,just wanted to check if there’s anything I can do to help move this PR forward. Thanks for your time!
|
@microsoft-github-policy-service agree |
extraFileExtensions through ProjectService.setHostConfiguration in the plugin has no effect.
|
Given the short future of language service plugins in this particular architecture going forward, and the risk of breaking other plugins, I don't think we want to mess with this. This code is basically untestable (we have no idea what plugins in the wild are doing) and clearly works well enough for the plugins that are already out there. |
|
okay, understand. It can be resolved temporarily through |
If the plugin is enabled before
this.updateRootAndOptionsOfNonInferredProjectand the project service host configuration is changed throughprojectService.setHostConfigurationin the plugin, enabling the plugin will result in a recursive call toloadConfiguredProject, then the outerloadConfiguredProjectwill finally callthis.updateRootAndOptionsOfNonInferredProjectwith the parameters that before the plug-in was enabled.Fixes #61302