How to make Roslyn syntax Visualizer expander work?

When Roslyn is installed, it comes with some great demo tools. Firstly, the most valuable for those who want to study the syntax trees in more detail is the Visualizer Tool Window Syntax , which shows the syntax tree of active * .cs files.

Everything worked fine when I ran this extension and tried it in a test instance of Visual Studio. But when I installed this extension, it no longer works. I still have View -> Other Windows -> Roslyn Syntax Visualizer, but only an empty tool appears.

Does anyone have the same problem and know the solution?

I suggest that perhaps I need to copy the DLL files that this extension creates during the rebuild, but I don’t know where to put it.

Later I found another interesting detail - when I launch my own extension, the Syntax Visualizer Tool works! Thus, it only works in a test instance of Visual Studio. Why should this be so?

+6
source share
2 answers

The Visualizer syntax only works when starting Visual Studio with Roslyn enabled. When you start a test instance of Visual Studio, Roslyn automatically turns on. You can manually start Visual Studio with Roslyn by adding the / rootsuffix Roslyn to the shortcut, but make sure that Roslyn is not finished yet. It may not be recommended to enable it by default, depending on what you are working on. Of course, you can also just create another shortcut with Roslyn so that you can choose the one you want.

If you see [Roslyn] on the code tabs in Visual Studio, you can use the visualizer. Another way to check Roslyn’s inclusion is to browse your extensions. Roslyn language learning services must be there to work. If this is not the case, then the visualizer can be opened, but it will not display any content.

Further information on the visualizer extension can be found here .

+13
source

Nico will most likely answer. Look in the debug properties of the Syntax Visualizer project to see what starts with / rootsuffix Roslyn. In addition, without starting this method, you should see the Syntax visualizer in the editor windows C # REPL and C # Script; since these are editors of Roslyn CSharp.

+1
source

Source: https://habr.com/ru/post/908852/


All Articles