Large designer files crash converter (within VS) during formatting
See original GitHub issueSteps to reproduce
- convert solution
- crash in phase 1 of 2 converting forms
Error message shown
- Office\COGuiCommon\IdentArtikel\IdentArtikelForm.Designer.vb - conversion started
- Office\COGuiCommon\Tourenplan\TourenplanForm.Designer.vb - conversion succeeded
- Office\COGuiCommon\Vertraege\VertragsMaschinenHinzufuegen\VertragsMaschinenHinzufuegenForm.Designer.vb - conversion started
Error while formatting and converting comments: System.InvalidOperationException: Exception of type ‘System.InvalidOperationException’ was thrown.
Error while formatting and converting comments: System.InvalidOperationException: Exception of type ‘System.InvalidOperationException’ was thrown.
at System.Runtime.CompilerServices.ConditionalWeakTable2.VerifyIntegrity() at System.Runtime.CompilerServices.ConditionalWeakTable
2.TryGetValue(TKey key, TValue& value)
at Microsoft.CodeAnalysis.GreenNode.GetAnnotations()
at Microsoft.CodeAnalysis.GreenNode.HasAnnotation(SyntaxAnnotation annotation)
at Microsoft.CodeAnalysis.CSharp.Formatting.TriviaDataFactory.Analyzer.AnalyzeWhitespacesInTrivia(SyntaxTrivia trivia, AnalysisResult& result)
at Microsoft.CodeAnalysis.CSharp.Formatting.TriviaDataFactory.Analyzer.Analyze(SyntaxTriviaList list, AnalysisResult& result)
at Microsoft.CodeAnalysis.CSharp.Formatting.TriviaDataFactory.Analyzer.Leading(SyntaxToken token)
at Microsoft.CodeAnalysis.CSharp.Formatting.TriviaDataFactory.CreateLeadingTrivia(SyntaxToken token)
at Microsoft.CodeAnalysis.Formatting.TokenStream.GetOriginalTriviaData(TokenData token1, TokenData token2)
at Microsoft.CodeAnalysis.Formatting.TokenStream.GetColumn(TokenData tokenData, Func3 triviaDataGetter) at Microsoft.CodeAnalysis.Formatting.FormattingContext.AddAnchorIndentationOperation(AnchorIndentationOperation operation) at Roslyn.Utilities.EnumerableExtensions.Do[T](IEnumerable
1 source, Action1 action) at Microsoft.CodeAnalysis.Formatting.AbstractFormatEngine.Format(CancellationToken cancellationToken) at Microsoft.CodeAnalysis.CSharp.Formatting.CSharpSyntaxFormattingService.Format(SyntaxNode node, AnalyzerConfigOptions options, IEnumerable
1 formattingRules, SyntaxToken token1, SyntaxToken token2, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Formatting.AbstractSyntaxFormattingService.FormatIndividually(SyntaxNode node, AnalyzerConfigOptions options, IEnumerable1 rules, IList
1 spansToFormat, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Formatting.AbstractSyntaxFormattingService.Format(SyntaxNode node, IEnumerable1 spans, Boolean shouldUseFormattingSpanCollapse, AnalyzerConfigOptions options, IEnumerable
1 rules, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Formatting.Formatter.GetFormattingResult(SyntaxNode node, IEnumerable1 spans, Workspace workspace, OptionSet options, IEnumerable
1 rules, CancellationToken cancellationToken)
at ICSharpCode.CodeConverter.Shared.OptionalOperations.Format(SyntaxNode node, Document document)
at ICSharpCode.CodeConverter.Shared.OptionalOperations.MapSourceTriviaToTargetHandled[TSource,TTarget](TSource root, TTarget converted, Document document)
Details
- Product in use: e.g. VS extension
- Version in use: 8.4.1.0
- Did you see it working in a previous version, which? no
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
In #774 I’ve made a change to decrease the amount of boilerplate for events in many common cases. Hopefully this will help mitigate the issue until a fix can be found
For command line, start with
dotnet tool install ICSharpCode.CodeConverter.codeconv --global
Then the help on it should be enough to go on from there