|
How can you implement regions a.k.a. code collapse for JavaScript in Visual Studio?
If there are hundreds of lines in javascript, it'll be more understandable using code folding with regions as in vb/C#.
#region My Code #endregion
Started by Prasad on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
This method allows you to put a description after the //#region keyword ala C# and shows it in the code as shown:
Example code:
//#region InputHandler var InputHandler = { inputMode: 'simple', //simpleHundreds of lines of....
|
|
As part of a project I am working on I have been asked to split all the code in classes into regions eg:
#region public methods #endregion public methods #region public properties #endregion public properties #region private methods #endregion private...
Started by jat45 on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Needing regions is a sign you have too much code in one class/method: The Problem With ....
If you want to encapsulate code, extract it and put it into it's own class.
Don't do it!: Code regions are counter-productive.
|
|
Every so often, I'm done modifying a piece of code and I would like to "lock" or make a region of code "read only". That way, the only way I can modify the code is if I unlock it first. Is there any way to do this?
Started by danmine on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
A single class whose source code change this code you are fired....
Split up the code into separate files and then check into a source control system?
The easiest way which would work in many cases is to make it a partial type - i.e.
|
Ask your Facebook Friends
|
I was wondering if there is an equivalent to Visual Studio's #regions in RAD Studio.
We use CodeGear's delphi and c++builder IDEs where I work and I would love to be able to use something like regions.
My coworkers and I have yet to find an equivalent...
Started by stevosaurus on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
YouYou can apply a special {$REGION 'Region Name'} directive to mark a "named" collapsible regions may....
To mark code as a region, surround it with the REGION and ENDREGION directives.
In the code editor.
|
|
When writing c#, in Visual Studio, you can set regions to group code accordingly. Being new to Xcode I can't seem to find a similar feature.
Started by Ferds on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Moreover, you can put a mark in any point in the code with:
#pragma mark your title as long for being pragmatic but it's "Xcode", not....
Using Xcode editor, you can collapse or expand any block of code by clicking in the little left margin.
|
|
Possible Duplicates:
Do you say No to C# Regions?
Is the #region directive really useful in .NET?
I find them annoying and not improving readability.
Started by Lieven Cardoen on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
They are not annoying, your gf can be annoying.
This is an opinion not a question, I like regions for seperation of specific code.
To each his own.
The ones I'm not interested in when viewing the code.
|
|
Is there any way to create foldable regions of code in ActionScript 3 (read this as Adobe Flash CS3 built-in editor). I'm looking for something like in MS Visual studio so that I can do:
#region "Event handlers" ... big list with methods here #end region...
Started by Perica Zivkovic on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Just select/highlight a few lines of code and click the - icon on....
Flash CS4 has a code folding feature.
And it is free.
It has some folding options, but event more importently it has intellisense and automatic code generations.
|
|
Hi,
While the code is growing big it is getting harder and harder to keep everything well organized. One thing I liked very much the time I developed in .NET was #region/#endregion which enabled to organize the code in logical groups and made further ...
Started by niko on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
The problem with regions is they can make files filled with thousands....
In Java, you use packages and projects to organize your code for arbitrary code folding or code folding based on comments.
And see what options they have.
|
|
I use ReSharper's code cleanup all the time, but sometimes I have code formatted in a way that makes it easier to read than ReSharper's formatter makes it. Is there a way to mark part of your file with comments or something to make it skip formatting ...
Started by jayrdub on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Probably not, but you can try writing your own Resharper plugin
I had a discussion with Resharper support about this, their answer:
Thank you very much for this information! We will discuss if we can support such formatting style in one of the future... .
|
|
We all sometimes have to write potentially dangerous, unsafe or just poorly written piece of code. Usually it is done in a hurry and needs to be rewritten later.
My question is: How can I easily and visually mark this code in VS 2008?
For example, I'm...
Started by Dmitry on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Let the compiler throw warnings:
#if RELEASE #warning This has to rewritten later #endif
http://msdn.microsoft.com/en-us/library/963th... .
I can then sort the TODO list into the correct order .
I use "TODO" followed by a priority indicator, "P1", "P2" etc .
|