Repository navigation
Conversation
This is a strong claim that isn't well-supported by the code. It's allowed for the editor to re-send config even in the absence of a change, and it's easy to set up your editor to allow toggling preferences a lot for whatever reason (e.g. inlay hints). Without stronger justification than "it's rare so it's OK" I'd really prefer this just be done correctly (check the preferences values that matter). |
|
Thanks, that's fair. I changed it to clear the cache only when the preferences returned by |
|
I have a follow-up fix ready that depends on this change. It makes the language server honor language-scoped settings (e.g. Would you prefer I wait for this one to land first, or open the follow-up now as a stacked PR? |
Fixes #64820
Registry.specifierCachewas only cleared whenautoImportSpecifierExcludeRegexeschanged, so a change toimportModuleSpecifierPreferenceorimportModuleSpecifierEndingkept returning specifiers computed with the old preferences for files that were already open.This compares all preferences returned by
ModuleSpecifierPreferences()(the ones passed toGetModuleSpecifier) through a newmodulespecifiers.UserPreferences.Equal, and clears the cache only when they differ.Added
TestUserPreferencesEqual, andTestAutoImportModuleSpecifierAfterUserPreferenceChange, which changesautoImportSpecifierExcludeRegexes,importModuleSpecifierEndingandimportModuleSpecifierPreferenceone at a time on an open file and checks the auto-import specifier after each change.