Is there an IDE out there that does structural syntax highlighting?

六眼飞鱼酱① 提交于 2019-12-02 22:08:40
CMS

The closest thing that I've seen is Codekana, although doesn't have "background syntax-highlighting" it colorizes the different flow-control structures:


(source: codekana.com)



(source: codekana.com)

  • Red for loops
  • Green for if-blocks
  • Brown for else-blocks
  • Aquamarine for switch-blocks
  • Olive for exception blocks
  • Orange for 'return'

I'm the author of Codekana. Indeed, what you describe above was the main goal for the product. BTW, I'm about to publish an article about the "making of" and the underlying technology, which is pretty nifty. It will probably be available next week (March 26, '09 or so). Recommended reading, if I may say so myself.

The reason Codekana only provides outlines, instead of a colored background, are limitations in VS's text rendering extensibility. I will hopefully be able to implement a solid-background version at some point in the future, although it will definitely require serious hacking and "rocket surgery".

I would have commented above, instead of providing another answer, but my reputation doesn't allow commenting. :(

[UPDATE: Thanks for the upvotes, now I can comment!]

Sam Saffron

Coderush does structural highlighting:


(source: devexpress.com)

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

The current BlueJ editor does exactly what you describe:

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.

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?

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.

You should try this Addin and you will never work in visual studio without it, http://www.jetbrains.com/resharper/features/index.html

PS: I'm not affiliated with this company or product but I'm an addict using it and I can never work without it, it saves me alot of time in my coding tasks and code exploration and debugging.

I'm working on a Visual Studio extension inspired by this question. You can see what I have so far here:

http://lorgonblog.wordpress.com/2010/11/12/the-f-compiler-source-release-making-it-easy-to-write-cool-visual-studio-extensions/

primfaktor

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:

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

I find it quite handy.

allmargins extension works for me in visual studio 2010

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!