问题
This is a feature request for the writers of Visual Studio and any other programmer's editor.
Consider a literate program as follows:
/* File Name: LiterateProgram.h */ // \begin{comment}
#pragma once
#include "myHeader.h"
/* \end{comment}
%\bigskip
\begin{lstlisting} %
*/
class CSomeClass : public CSomeBase {
public:
float someFunction(float some paramter);
};
// \end{lstlisting} \begin{comment}
/* \end{comment} %*/
I'd like an editor window with two small icons representing (COLLAPSE_CODE) and (COLLAPSE_COMMENTS) in the bottom right corner. If COLLAPSE_COMMENT, then the view of the file would look like:
+
#pragma once
#include "myHeader.h"
+
class CSomeClass : public CSomeBase {
public:
float someFunction(float some paramter);
};
+
If COLLAPSE_CODE, then the view of the file would look like:
/* File Name: LiterateProgram.h */ // \begin{comment}
+
/* \end{comment}
%\bigskip
\begin{lstlisting} %
*/
+
// \end{lstlisting} \begin{comment}
+
/* \end{comment} %*/
Bonus points for displaying a side-by-side splitscreen of both views simultaneously. (maybe that's the behaviour if both ICONS are chosen).
回答1:
Try this
#region abc
//your code here
#endregion
http://msdn.microsoft.com/en-us/library/9a1ybwek%28v=VS.100%29.aspx
来源:https://stackoverflow.com/questions/3701317/feature-request-for-a-text-editor-with-support-for-literate-programming