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

Source Editor Enhancements

tashker__michael
Beginner
1,738 Views
Well, we've been waiting for source browsing functionality for... forever. So, having installed the new Fortran updated released mid-2/2012, and having set fortran/advanced options as specified in the (sparse) documentation, I find that the Object Browser does indeed display a pane with routines by project or namespace, as advertised. Right click a routine name and select Find Usages (or Find Usage Advanced) and you get a tooltip 'Usages of whatever.f90 not found'. Well, that's a kick in the pants. In the editor, right-click a (global) variable or function name in a function and select Go To Definition, and nothing happens. Select Find All References (or ctrl-k r) and the search pane opens with Search found no results.

Here's my options:
Collect Object Browser Information: True
Enable Find All References: True
Enable Go To Definition: True

I restarted VS2010 as told, and even rebuilt my project. Are there any options I'm missing?
0 Kudos
13 Replies
onkelhotte
New Contributor II
1,738 Views
I have the same problems.

It would really be a nice feature, but it doesnt work as it should. Sometimes I had "Search found no results", sometimes I found had a few. I dont know why.

Markus
0 Kudos
Steven_L_Intel1
Employee
1,738 Views
You are searching for usages of filenames? The source browser never supported such a thing. You can search for Fortran identifiers.

Can you provide an example project and illustrate the problems you are seeing?
0 Kudos
tashker__michael
Beginner
1,737 Views
Allllll riiiighty. Options | Options.png is a shot of my Options | Text Editor | Fortran | Advanced. Hope I've set the right ones.

Here's the issue in the text editor:
I open a file with a Call statement. I right click the routine name. The shot Search in Text Editor | Editor Go To Definition.png is me right-clicking the routine name. Nothing happens. The shot Search in Text Editor | Editor Find All References.png is me right-clicking the routine name. The Find Symbol Results pane shows "Search found no results".

Here's the issue in the Object Browser:
Next we go to the Object Browser. The shot Search in Object Browser | Object Browser Find Usages is me right clicking the routine name (same as above). The shot Search in Object Browser | Object Browser Usages Not Found Tooltip.png is the result. Interesting aside: what seems not to be found (in the tooltip) is the file containing the routine, not the routine itself.



0 Kudos
tashker__michael
Beginner
1,738 Views

Oh, BTW, same thing as above happens if I select a variable instead of a routine name.

0 Kudos
Steven_L_Intel1
Employee
1,737 Views
Would you be able to attach a ZIP of the sources? I find that the browsing works fine in some programs and not so well in others. I don't know what the key difference is, but if I have examples that don't work I can send them to the developers.
0 Kudos
abhimodak
New Contributor I
1,738 Views
Hi

I did not quite follow the object browser issue but I think for the Editor the reported behavior only happens when the entire method name is "selected".

That is, (a) if you have "Call Method", (b) first double click the entire word Method, (c) Now right click and select Goto Definition or Find all references. This will result in nothing.

On the other hand, if the cursor is anywherebetween left of M to left of d of the word "Method" then both Goto and Find work as expected.

I hope I have not misunderstood the editor problem.

Abhi
0 Kudos
ZlamalJakub
New Contributor III
1,738 Views
I have problem that "Go to definition" sometimes does not go to the definition of the subroutine but to the definition of interface of subroutine (I am using one big module with interfaces to all subroutines).

Does anybody observed this behavior?
0 Kudos
Steven_L_Intel1
Employee
1,738 Views
The developers have told me that they have fixed the problem where if you have a selection that the Go To Definition and Find All References don't work. They do generally work if you simply right-click on an identifier. This fix will be in a version released later this year.

As for going to the interface, as far as the language is concerned that is the definition.
0 Kudos
onkelhotte
New Contributor II
1,737 Views

Thats good to know that it wont work when you select the varibale / function / subroutine name.

But it only searches in the file that you are actually in. For example, when you have a function foo that is declared in foo.f90, you will only find this one and not any calls from other source files when in main.f90 foo is being called etc.

Same when a variable is declared in a module, like in the DLL_shared_data sample. You find shared_variable only in the shared_globals.f90 and not in the main.f90 in the other project.

Markus

0 Kudos
tashker__michael
Beginner
1,738 Views
@Abhi: you're right. No results when the entire identifier is selected, better when cursor is within identifier word.

So let's see the status of things now.

In Object Browser
1. Double click routine name--opens file with routine. Excellent!
2. Right-clicking routine name to find references--am not sure this can be done in object browser... I have other 'find' items on context menu that are not put there by Fortran.
3. Conclusion: Object Browser browses as advertised.

In Text Editor--Routine Name
1. Right-click routine name and Go to Definition (or F12)--opens file at routine. Excellent!
2. Right-click routine name in file1.f90 and Find All References (or ctrl-k-r) finds references to the routine in the current file plus its definition. Hmm. Try it in another file file2.f90 that references it. Ooh. Now it finds references in file1, file2, and its definition. Ah! The pattern becomes clear. Find All References means find references in files that are open in the IDE, not files in the project (or solution). Yes, that's what it does.

In Text Editor--Local Variable Name
Go to Definition and Find all references work fine.

In Text Editor--Global Variable Name (i.e. variable in common)
1. Go to Definition does nothing. The variable is in a common whose definition is in an includedfile; e.g.
include 'comio.inc'
where comio.inc is a file containing variable and common definitions.
2. Find All references does Find In Open Files (only). A bit limiting, eh?

Overall conclusions
1. Selecting a routine or variable name for definition or references only works when the identifier is not fully selected. Assume this will eventually be fixed--it's only a paper-cut.
2. Find All References seems to be defined as Find All References in Open Files. This seems limiting, eh?
3. Go to Definition of global (common) variable with definition in another file does not work at all. Should I expect this to work?

@Steve: any comments on overall conclusions?
0 Kudos
Steven_L_Intel1
Employee
1,738 Views
The developers tell me that the "selection" issue is fixed for a future release. No, Find All References should find them in all files in your project. Go To Definition where the definition is in another file is supposed to work, but I have seen some cases where it doesn't.

The source browsing feature is getting a significant upgrade in the next major release - it should be faster and work better.
0 Kudos
Arthur_van_Dam
Beginner
1,738 Views
Here's another issue report on the Visual Fortran editor enhancements. Don't know whether this is the right place, or if there's an issuing system?
Anyway, I'm very happy with the new enhancements.
I found a possible issue with the GotoDefinition/Outlining: my source files contain quite a few subroutines and functions, and when a function is defined with its type in the declaration line, the file is not further parsed. So:

subroutine foo(arg1, arg2)
!... this subroutine is parsed fine
end subroutine foo

integer function bar()
! This is not parsed.
end function bar

subroutine tree()
! .. this and any following code is also not parsed
end subroutine tree


Only subroutine foo appears in the NavigationBar dropdown list.


A second issue: I have multiple source files open. If I doubleclick a new file in the solution explorer, its NavigationBar displays the subroutines correctly. If I now click on another tab/file that was already open, its NavigationBar is empty. I close it, and reopen it through SolutionExplorer and then the NavigationBar is properly populated again.

Any idea on these issues?
0 Kudos
Steven_L_Intel1
Employee
1,738 Views
You can report problems here or use Intel Premier Support. I will see if I can reproduce the problems you report.
0 Kudos
Reply