Skip to content
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

Correctly return E_NOTIMPL when asked for file code models for non-source #60870

Conversation

jasonmalinowski
Copy link
Member

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

…urce

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
@jasonmalinowski jasonmalinowski force-pushed the fix-codemodel-exception-for-additional-files branch from c943470 to 4dcbfdd Compare April 25, 2022 18:53
@jasonmalinowski jasonmalinowski marked this pull request as ready for review April 25, 2022 18:54
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner April 25, 2022 18:54
@jasonmalinowski jasonmalinowski merged commit 9f6dd98 into dotnet:main Apr 25, 2022
@ghost ghost added this to the Next milestone Apr 25, 2022
@jasonmalinowski jasonmalinowski deleted the fix-codemodel-exception-for-additional-files branch April 25, 2022 21:02
@dibarbet dibarbet modified the milestones: Next, 17.3.P1 Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants