views:

45

answers:

1

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).

+4  A: 

Try this

#region abc
//your code here
#endregion

http://msdn.microsoft.com/en-us/library/9a1ybwek%28v=VS.100%29.aspx

blizpasta
quickdraw mcblizpasta. +1
SnOrfus
Thanks, but I don't thing regions will cut it. Regions would help divide a long file into collapsible regions, but what I want is just to be able to toggle between two views of the same file at the click of a button.... one view that has TeX'able literate-programming comments, the other that has compilable source code.
SmileAndNod