KirillOsenkov / RoslynQuoter

Roslyn tool that for a given C# program shows syntax tree API calls to construct its syntax tree
http://roslynquoter.azurewebsites.net
Apache License 2.0
922 stars 118 forks source link

Using an attribute causes an exception #9

Closed Vannevelj closed 8 years ago

Vannevelj commented 8 years ago

Input:

[Obsolete]
class C { }

Result:

Microsoft.CodeAnalysis.Scripting.CompilationErrorException: (3,19): error CS0246: The type or namespace name 'AttributeSingletonListSyntax' could not be found (are you missing a using directive or an assembly reference?) at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.ThrowIfAnyCompilationErrors(DiagnosticBag diagnostics, DiagnosticFormatter formatter) at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.CreateExecutor[T](ScriptCompiler compiler, Compilation compilation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Scripting.Script1.GetExecutor(CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Scripting.Script1.RunAsync(Object globals, CancellationToken cancellationToken) at Quoter.Evaluate(String apiCallString, Boolean normalizeWhitespace) at Quoter.AddModifyingCall(ApiCall apiCall, MethodCall methodCall) at Quoter.AddModifyingCalls(Object treeElement, ApiCall apiCall, List1 values) at Quoter.QuoteNode(SyntaxNode node, String name) at Quoter.Quote(Object treeElement, String name) at Quoter.<QuoteList>b__29_0(Object o) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at Quoter.QuoteList(IEnumerable syntaxList, String name) at Quoter.QuotePropertyValue(SyntaxNode node, PropertyInfo property) at Quoter.<>c__DisplayClass26_0.<QuotePropertyValues>b__2(PropertyInfo propertyInfo) at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable`1 collection) at Quoter.QuotePropertyValues(SyntaxNode node) at Quoter.QuoteNode(SyntaxNode node, String name) at Quoter.Quote(Object treeElement, String name) at Quoter.Quote(SyntaxNode node) at Quoter.Quote(String sourceText) at QuoterService.Controllers.QuoterController.Get(String sourceText, Boolean openCurlyOnNewLine, Boolean closeCurlyOnNewLine, Boolean preserveOriginalWhitespace, Boolean keepRedundantApiCalls, Boolean avoidUsingStatic)

SLaks commented 8 years ago

Great minds think alike :) #StackOverflow

Vannevelj commented 8 years ago

Haha, looks like it indeed!

KirillOsenkov commented 8 years ago

Fixed!