More on red-nodes
There was once an example presented, describing what happens after inserting new node to the tree in a thread named "how the tree transformations works?": A (A) / \ / \ B C -> (B) C / / \ D D (E) A...
View ArticleHow does ReplaceNodes work?
How does ReplaceNodes() method stores results of replacements? That is, I have two nested block statements: // block #1 { // block #2 { } } I store them in variables block1 and block2. Now I execute...
View ArticleNamespaceDeclarationSyntax.GetFullName() always return ""
Why does NamespaceDeclarationSyntax.GetFullName() always return empty string?Ocean for Petrel framework developer.
View ArticleSand boxed Support in ScriptEngine
What are the plans for introducing Sandboxing support for Scripting Host? Something like this. var evidence = new Evidence(); evidence.AddHostEvidence(new Zone(SecurityZone.Internet)); //Sandboxed...
View ArticleWhat is the replacement in Sep CTP for SyntaxNode.AddNodes() in Jun CTP?
What is the replacement in Sep CTP for SyntaxNode.AddNodes() in Jun CTP?Ocean for Petrel framework developer.
View ArticleIs it possible to dynamically generate WinForms using Roslyn?
Hi everyone, I am exploring Roslyn framework, which so far looks very powerful, and anxiously expecting date when this project is going to become a regular part of .Net framework. There are many code...
View ArticleEditing .csx files belonging to a project should assume...
You are probably already thinking about this but I'll throw in my $0.02. I have made a Scripts folder in my class library project where I keep work-in-progress code that is not ready to become a...
View ArticleCommonSyntaxNode.HasDiagnostics
I was using CommonSyntaxNode.HasDiagnostics. It seems to be replaced, What should I use now?
View ArticleDocument updates in CodeAction
Hi, Usually, the code action's GetEdit method looks like below: public CodeActionEdit GetEdit(CancellationToken cancellationToken) { // Do some stuff to build up newRoot out of document root return new...
View ArticleUnderstanding Documents
If I am introducing change in one of syntax trees by adding a new method's declaration, then there should be new IDocument, IProject and ISolution instances created (on the spine of entire tree up)....
View ArticleWill unsafe code be allowed in C# Interactive?
I have been looking forward to unsafe support in Roslyn but at the moment it doesn't seem to be usable in C# Interactive. Here's what I see right now: double test = 5; double* pTest = &test; (1,1):...
View ArticleDocumentation for annotations?
Hi, I am struggling to understand annotations and how they affect generated code. For example what does: CodeAnnotations.Formatting.AddAnnotationTo(node) Actually *do*? I can't find any documentation...
View ArticleGet Roslyn CTP for Visual Studio 2010
I have Microsoft Visual Studio Ultimate 2010 installed and would like to install Roslyn on it. However when I download the September 2012 CTP of Roslyn and try installing it , I get an error that I...
View ArticleData flow analysis over selected text
I would like to perform data flow analysis over arbitrarily selected text within some expression. Normally, I would just get the ExpressionSyntax node for given TextSpan. The problem I encounter is...
View ArticleException : Replace string literal with method call
Hi, I want to replace a string with method call. For example, string s="Hello World"; with string s =this.GetHelloWorld(); I have created an ExpressionStatementSyntax with the method call in...
View ArticleCustom actions for the compiler pipeline
Hi, I am wondering if it is possible to write a compiler 'extension' which will be executed whenever the compiler runs. What I am trying to archive is to build a SyntaxRewriter which is handled like...
View ArticleUnable to Sandbox CSharp ScriptEngine
When I attempt to use to simple sandboxing API to launch the script engine, I get the following error message: Attempt by security transparent method 'ScriptRunner.Runner..ctor()' to access security...
View ArticleExperimental StyleCop fixer built using Roslyn.
I hope this won't be considered spam, but I've started working on a StyleCop fixer using Roslyn - StyleCopMagic. You can find it on GitHub: https://github.com/grokys/StyleCopMagic It's very early...
View ArticleRefactor common features into interfaces?
I am currently writing a StyleCop fixer using Roslyn and I want to reorder members of classes, structs, interface and namespaces according to member type and access level. Each of the SyntaxNode...
View ArticleDetermine whether SyntaxNode is in an #if directive
What is the easiest way to determine whether any SyntaxNode is enclosed in and #if ... #endif directive?
View Article