-
Notifications
You must be signed in to change notification settings - Fork 4k
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
ArgumentException from Microsoft.CodeAnalysis.Completion.Providers.SymbolCompletionItem.Create #11193
Comments
I am hitting this multiple times during day - this is blocking dogfooding of new Roslyn bits (D14 Update3 features) and severely impacting my productivity. Marking this as urgency soon. |
Actually, isn't this as an IDE bug as the exception is coming from Intellisense completion provider (Microsoft.CodeAnalysis.Completion.Providers.SymbolCompletionItem.Create)?
|
@mavasani You're right, the ide team should look at this first. |
@mavasani sorry the notifications for this dropped into a Github filter and I didn't see it. Happy to move it along if turns out to be Compiler related. |
We are seeing the syntax nodes returned from static void TestSymbolSyntaxTrees(ISymbol containingSymbol)
{
var compilation = (containingSymbol.ContainingAssembly as ISourceAssemblySymbol)?.Compilation;
if (compilation != null)
{
foreach (var declaringLocation in containingSymbol.DeclaringSyntaxReferences)
{
var node = declaringLocation.GetSyntax();
Assert.True(compilation.SyntaxTrees.Contains(node.SyntaxTree));
}
}
} |
@jaredpar This looks like a compiler bug to me. I would expect |
FYI: I am still hitting this crash multiple times a day. |
Had a meeting of the minds with @rchande and @mattwar, here is the plan:
private static void GetInteriorSymbols(ISymbol containingSymbol, List<ISymbol> symbols)
{
var compilation = (containingSymbol.ContainingAssembly as ISourceAssemblySymbol)?.Compilation;
if (compilation != null)
{
foreach (var declaringLocation in containingSymbol.DeclaringSyntaxReferences)
{
var node = declaringLocation.GetSyntax();
if (node.Language == LanguageNames.VisualBasic)
{
node = node.Parent;
}
var semanticModel = compilation.GetSemanticModel(node.SyntaxTree);
GetDeclaredSymbols(semanticModel, node, symbols);
}
}
} To something like this (bail out if the syntax tree is not part of the semantic model): private static void GetInteriorSymbols(ISymbol containingSymbol, List<ISymbol> symbols)
{
var compilation = (containingSymbol.ContainingAssembly as ISourceAssemblySymbol)?.Compilation;
if (containingSymbol.DeclaringSyntaxReferences.Any(x => !compilation.SyntaxTrees.Contains(x.SyntaxTree)))
{
return;
}
if (compilation != null)
{
foreach (var declaringLocation in containingSymbol.DeclaringSyntaxReferences)
{
var node = declaringLocation.GetSyntax();
if (node.Language == LanguageNames.VisualBasic)
{
node = node.Parent;
}
var semanticModel = compilation.GetSemanticModel(node.SyntaxTree);
GetDeclaredSymbols(semanticModel, node, symbols);
}
}
} 3.Create a bug asking for |
I run into this bug several times a day and have several files where crash is reproduceable. Very annoying. Any idea when it gets fixed? |
Soon @schuettecarsten. You can see the PR here #11398 |
Verify plz @jmarolf |
I hit it multiple time a day in some files, can't really change anything in some of them anymore using Visual Sudio. Is there a timeline for a fix ? |
I've hit this on: Application: devenv.exe |
Note: this is in SymbolKey. Whereas the original fix was in SymbolId. We'll likely need the same fix in SymbolKey. Note: ideally we would not have SymbolKey at all. #11403 tracks the work to remove it and absorb it's functionality into SymbolId. |
@jmarolf I installed a build to test the OutOfMemory problem we are having (The one that was linked in #10365) at some point but since removed it (It was creating errors at startup) maybe some bits remains. I didn't pay attention to all the answers to #10365 about the vsix it not being removed correctly as I didn't think I was affected but it seem to be the case 😦 |
@CyrusNajmabadi @jmarolf - is this issue fixed now? |
The exception is gone, but the correct behavior is not fixed. |
Moving to 2.0 for the correct behavior fix. |
Removing |
Actually, closing this in favor of #11436. |
Version Used: 1.3.0.60508
Steps to Reproduce:
Expected Behavior:
No Crash
Actual Behavior:
VS Crashes with
ArgumentException
The text was updated successfully, but these errors were encountered: