问题
The SPE IDE that I use for my Python code uses this "visual cue" that looks like a vertical dashed line for alignment of (what I would call) function blocks. How can I get this option in Visual Studio 2008?
Here is what it looks like:
回答1:
I've seen it called structural highlighting or code outlining.
There's a Visual Studio plug-in called CodeRush from Developer Express that supports this (bottom of the page) and a lot more.
update:
As divo mentioned, there is a free lite version of CodeRush. I confirmed that it includes structural highlighting.
回答2:
Unfortunately, Visual Studio does not support indentation lines out of the box.
回答3:
These lines are arguably more useful in Python where indentation denotes nesting. In C#, nesting is explicitly marked by curly braces. I feel as though curly braces provide the visual cues I need to see this kind of thing, so you might just try to persevere -- in time the cognitive load associated with glimpses of C# versus glimpses of Python will reach equilibrium.
VS2010 implements the text editor in WPF and there are some examples online of creating plug-ins that augment the text editor area. This could be a fun project without being too difficult.
I am envious of Python's indentation-centric nesting. I wish that the C# compiler supported something like that. I wish that white space was part of the language. It would make tooling support for the language better as well.
来源:https://stackoverflow.com/questions/1448843/what-is-this-dashed-line-called-that-aligns-function-blocks-in-my-ide