Correctly return E_NOTIMPL when asked for file code models for non-source #60870
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It appears the existing contract when the language service is asked for a file that we don't know about is to return E_NOTIMPL: this assumption is encoded in other places like https://github.com/dotnet/project-system/blob/aca656810125ee6be02c47a5195ddde008fe1ae5/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/ProjectContextCodeModelProvider.cs#L70
In any case, we had a bug where if the caller asked about a file that happened to be an additional file, our check for the
missing file would not return E_NOTIMPL and we'd throw other exceptions later.
Fixes https://developercommunity.visualstudio.com/t/Adding-strings-to-resx-file-pops-a-modal/1511601