Is there an IDE out there that does structural syn

2019-03-12 00:38发布

Somewhat inspired by this question about a graphical programming environment. I don't think that C++ or C# are really conducive to this type of environment, but perhaps there's something halfway there.

Lot's of IDEs that I've used will use syntax highlighting to change the foreground (or even the background) colour of text for keywords, strings, comments, etc...

Are there IDEs out there that will highlight larger syntactic structures? Here's an example of what I'm thinking of.

Example code structure http://img256.imageshack.us/img256/9441/codestructure.png

(Please don't comment on my poor choice of colours... I'm not a graphic designer for a reason.)

While it's not a graphical drag-and-drop environment, the highlighting would still give an overall view of the structure of the code. Personally, learning C# after years of C++, I still catch myself tripping over the fact that at the end of a file you usually have the end of a class and the end of a namespace, so the end of a function is two-levels in. (In a C++ code file, the end of a function is usually at the top level of indentation). I help myself out there by throwing in little comments at the close brackets:

    } // end class 
} // end namespace

But it seems to me that some automatic colouring would make that completely unnecessary. Anyway, has this been done already? Bonus if it's an add-on to Visual Studio.

11条回答
Melony?
2楼-- · 2019-03-12 01:00

A nice idea. Personally, I really don't like folding editors, but this would be quite tolerable - you'd want to be able to toggle it on/off easily though. Perhaps someone has already done this for the hyper-programmable editors like vim and emacs?

查看更多
一夜七次
3楼-- · 2019-03-12 01:05

allmargins extension works for me in visual studio 2010

Tool-->Exention Manager --> search for allmargins

查看更多
霸刀☆藐视天下
4楼-- · 2019-03-12 01:14

Coderush does structural highlighting:

alt text
(source: devexpress.com)

It quite feasible you could write your own plugin with DevExpress that achieves your exact original screen shot.

查看更多
一纸荒年 Trace。
5楼-- · 2019-03-12 01:15

The Visual Studio IDE does this already, but with a different visualization - you can expand and contract nested blocks by clicking the +/- buttons on the left margin.

查看更多
欢心
6楼-- · 2019-03-12 01:19

I think Xcode 3 does roughly what you want, especially with Focus Follows Selection enabled. Individual blocks are highlighted as you hover over them in the sidebar.

查看更多
做个烂人
7楼-- · 2019-03-12 01:19

There's also a free extension that at least draws the guide lines colored according to what they belong to. For instance, if guides in green and so on:
Example screenshot

It's called StructureAdornment and you can get it in the Extension Manager or from the Visual Studio Gallery.

I find it quite handy.

查看更多
登录 后发表回答