Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

brace matching in VS

bruppel1
Beginner
3,700 Views
So my workplace is looking to upgrade a few machines from some really ancient compilers to a modern compiler.

I have been using Intel Fortran for a while so I recommended it. They performed a survey of the options and they have found that some options have a feature where, as one types an opening or closingparentheses, the matched closing or opening parentheses would be highlighted.

This is a serious feature, I didn't think it existed because if it did, Intel would have it. It wouldcertainly save me some headaches. Is this supposed to be part of the product and I just haven't found the configuration? If not, it would be a top priority in my opinion.

Other features such as automatically providing information on intrinsics and variable inputs to intrinsics are also not present. I get the impression that these features are present on many other environments but not intel fortran.

I'm sorry if this forum is not a great place to put feature requests, but I guess the first step for me is to be certain that the feature doesn't exist.
0 Kudos
21 Replies
Steven_L_Intel1
Employee
3,358 Views
This feature does not exist in Intel Visual Fortran. Parenthesis matching is not quite as big an issue as brace matching in C is, but I can see the value. I'm a bit uncertain of how you'd use this, though - is the idea to automatically add a closing parenthesis?

In the current (through VS2008) integration model, adding such features to the text editor is difficult. VS2010 completely changes how all this works and we might be able to add such features in the future. I will make sure this is on our "wish list". Thanks for asking.
0 Kudos
bruppel1
Beginner
3,358 Views
Hi Steve,
Thanks for confirming this. I am going to guess that it is frowned upon to post links directly to competitors' products so I'll refrain. But there are only so many products out there and this feature, along with tooltips and pop-up information for intrinsics is shown in a VS2008 shell in one of those products.

The idea that I am pursuing is not to automatically close the parenthesis, but to assist the user in sorting out which parenthesis belongs to which. Have you ever typed a formula in excel using multiple parens like "((("? The parentheses will get color coded, so when you do the closing parentheses you can sort out which closing parentheses belong to which opening ones. Also, if you put the cursor in the formula bar and move it left to right, as you move over a parentheses, that parentheses is highlighted and the matching parentheses is also highlighted.

This would get useful for any sitation where there code gets complicated. For instance:

tmap = ((point.y-mapMins.y)/mapDeltas.y)*(1.0- xNorm(point)) /2.0 + &
((point.z-mapMins.z)/mapDeltas.z)*(1.0+ xNorm(point))/2.0

This isn't the most complicated thing I've ever dealt with, and it only takes a bit of brainpower to sort it out, but it would take even less brainpower if the IDE was helping me out with color coding and highlighting.

0 Kudos
Steven_L_Intel1
Employee
3,358 Views
I know Lahey had some features like this implemented - who else? You can name them. We have had many requests for IDE features that Visual C++ has, and we are always interested in hearing your suggestions.
0 Kudos
jimdempseyatthecove
Honored Contributor III
3,358 Views
Steve,

I vote for the parenthesis highlighting feature too. Also the "jump to matching brace" that VS C++ mode has. Ctrl-} jumps to matching {,},(,),[,],... I haven't tried this in the newest version of IVF so I cannot say this feature is not there.

When I code in C/C++ I will often use

// { code added in V1.2.3.4
...
// } end code added in V1.2.3.4

Even though the braces are in comments, the jump to brace finds the matching brace. This is quite handy when I have rather long code sections which may span several functions.

In the older versions of IVF (ca V8) the integrations to VS didn't kill the brace matching. i.e.

! { code added in V1.2.3.4
...
! } end code added in V1.2.3.4

worked quite nicely.

Jim
0 Kudos
abhimodak
New Contributor I
3,358 Views
Hi Steve

Parenthesis matching is there in Absoft and Silverfrost. Absoft also show's it in the "Excel style" while SilverFrost only shows when you do a match.

I will also name two other features that are missing in Intel; I hope it is ok.

(1) The latter's integration in Visual Studio has a few other nice features such as showing a drop-down list of modules and procedures Absoft's editor also shows such drop-down list. Additionally, it is in the alphabetical order as opposed to Silverfrost's which is in the order as they appear in the file.

(2) In addition, automatic regioning (collapsing) works in SilverFrost.

I guess it is ok to wonder if SilverFrost can do it why not Intel....especially when the "personal edition" from Silverfrost is free.

Abhi
0 Kudos
bruppel1
Beginner
3,358 Views
Hi Steve,
Lahey was the product I was talking about. We have a die-hard Lahey user who is using features such as this as a reason to migrate to that product as opposed to Intel. He was also very concerned about whether we could change the screen font to red on black in Intel (we can) :)
0 Kudos
jimdempseyatthecove
Honored Contributor III
3,358 Views
Red on black is one of the worst color combinations to read. Drives my eyes bonkers.

Jim
0 Kudos
Steven_L_Intel1
Employee
3,358 Views
Thanks for all your comments. I'll be sure to pass them on.
0 Kudos
michael_green
Beginner
3,358 Views
In Visual Studio, place the cursor immediately to the left of a parenthesis whose partner you have lost, then enter CTRL ]. (That's a right square bracket.) The cursor will jump to the left of the partner parenthesis. It toggles both ways.

Mike
0 Kudos
Steven_L_Intel1
Employee
3,358 Views
Absoft has their own IDE - they do not use Visual Studio, but Silverfrost does. I never said that we can't do it, but that to date other things have taken priority.
0 Kudos
abhimodak
New Contributor I
3,358 Views
Hi Steve

I have used Absoft and I do know that they don't use Visual Studio...

I listed some of the tools that are good to have and which other vendors have made available. I believe that in this thread you had indicated that this feedback be given.

I also understand the priority issue and in my opinion that supporting F2003 has been the correct choice.

Abhi
0 Kudos
jossl
Beginner
3,358 Views
Hi,
I am using Visual Studio 2008 with the Intel Fortran Compiler, and I really am getting crazy because I haven't found out how to enable brace matching - that is if there if it now is possible.
Has the feature been implemented yet??
It can't be that complicated, the most simple text editors have brace matching...
Thanks
Lisa
0 Kudos
Steven_L_Intel1
Employee
3,358 Views
"Brace matching" is there, but for VS2010 only. Currently, the support matches Fortran block constructs, but in a future update parenthesis matching will be enabled.
0 Kudos
John_B__Walter
Beginner
3,358 Views

I'm currently using VS 2008, with IVF 11 on one system and IVF 12 on another.
Reading this thread, I decided to checkout CTRL-] and CTRL-}

They see () and [] and {} as well as '' and also "" pairs.

For CTRL-], if you are immediately to the left of one of the pair it toggles between them.
If you are elsewhere between them it goes first to the left of one, then toggles between them.

More interesting is CTRL-}
It highlights the entire phrase, from the first of the pair to the second of the pair.

Should you repeat, with a second CTRL-} while the first is already highlighted, it expands the the next containing pair. These two do not need to be on the same line (except for quotes), or the same type of pair.

! ( { this is a test [ with "bracket"] and

! brace} , and parenthesis) matching

For instance positioning the cursor within the word bracket in this comment above, CTRL-} will first

highlight "bracket" then [ with "bracket"] then extend from the { to the } on the second line, and again from the ( to the )
Doesn't this accomplish most of what you're talking about?

0 Kudos
onkelhotte
New Contributor II
3,358 Views

John, this currently works only in VS2008 and below, but it wont work in VS2010 any more.

As Steve said, Intel will re-provide this elemental feature in one of the next releases.

Markus

PS: Thanks for the CTRL-} advise. I didnt knew this feature until now :-)

0 Kudos
onkelhotte
New Contributor II
3,358 Views
Parenthesis matching works with Update 9, thanks a lot!

Markus
0 Kudos
Johannes_Rieke
New Contributor III
3,358 Views
Hi all,

if you are using a non-US keyboard layout and looking for the CTRL+] or CTRL+}, you will find it in the VS 2010 tools/options/environment/keyboard options under the names Edit.GoToBrace and respectively Edit.GoToBraceExtent. The default for a German layout is CTRL+` and CTRL+SHIFT+` (the key left to backspace).
Edit.GoToBrace works also on if and do statements. :-)

Greetings,
Johannes
0 Kudos
Johannes_Rieke
New Contributor III
3,358 Views
Hi all,

Visual brace matching, like in Scite or Notepad++, is still missing in update 11 :-( !

Please, implement it... I don't want to hit CTRL+] or CTRL+} ( or in German keyboard CTRL+` and CTRL+SHIFT+`) every time in complex formulas or even if clauses.

Kind regards,
Johannes
0 Kudos
Sebastien_D_
Beginner
3,358 Views
onkelhotte wrote:

Parenthesis matching works with Update 9, thanks a lot!

Markus

Hi, i'm currently using IVF 2010 with Update 12, and this feature is still missing ... So what do you mean ? As stated by Johannes, using CTRL+] or CTRL+} isn't really confortable. What about this feature by now ?
0 Kudos
Johannes_Rieke
New Contributor III
3,243 Views

Hi all,

I recently installed ifort 14.1 and I'm surprised by what is happening after the installation of the new Visual Studio integration (2010 I tested, 2012 I don't know)!

Cursor triggered Brace Matching is working!!!!!

Hooray!! Hooray!! Many thanks to the one who coded it!

It works for ( ), {} and [] ... When was it introduced? 13.1 had it not... Came it with 14.0? It took some time but it's there :-)

To change the font, you can use the 'Highlight Word' setting in the VS studio options for fonts and colors (see attachment).

 

By the way, how can I add a 'Fortran User Defined Keyword'. I found something for VS2008 which don't work for VS2010?

Best regards,

Johannes

 

0 Kudos
Reply