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

Broken syntax coloring for comments in *.f files?

abhimodak
New Contributor I
1,503 Views
Hi

I see that:
Comment lines begining with "C" in files of type *.f or *. are not getting appropriate syntax color with update 6. {This happens even when the file is a part of a Fortran project in VS.}


Abhi

0 Kudos
9 Replies
Steven_L_Intel1
Employee
1,503 Views
Tools > Options > Intel Visual Fortran > General. What is listed for Fixed Format Source extensions?
0 Kudos
abhimodak
New Contributor I
1,503 Views

Attached is a snapshot. I believe I have all the extensions correctly specified.

Abhi

0 Kudos
Steven_L_Intel1
Employee
1,503 Views
I see you are using VS2010 - fine. I tried this myself and it worked ok. Do .for files color for you?
0 Kudos
abhimodak
New Contributor I
1,503 Views
Hi Steve

Are you opening the file through a project? It would work for me there (for both *.f and *.for). Following is more complete information, I hope.

(1) The files with extension .f and .f90 show in windows explorerwith a specific icon that is signature of IVF. (See attached snapshot. I had to manually set opening of .f95 files with Visual Studio when opening it first time.) Double clicking the file opens it file in Visual Studio. When I open a *.f file by double clicking it, the comment's syntax coloring is not there. Other syntax coloring is there.

(2)Also comment's syntax coloringdoes not work if you do: File --> New --> File (and then fixed format *.for). Note that a free form i.e. .f90 file opened through New --> File does show syntax coloring for comments begining with "!".

(3) A special case: Syntax coloring for comment also fails if you change the file extension through VS. That is, (a) add a new .f90 file to your project. (b) Type something like "C Test" on the first line andsave the file. (c) Now right click--> ReName (ortwo left clicks)the file-name under "Source Files" from the Solution Navigator. Change the extension to f. The sytax coloring of comment is not there for the line begining with "C". (d) Save solution and close it. (d) Reopen the solution. The syntax coloring of the comment is correctly there.

Obviously case 3 is special and less problematic. Do you think there is a a problem with the VS integration? I have already did an uninstall and complete install.

Abhi
0 Kudos
Steven_L_Intel1
Employee
1,503 Views
I'm aware that you need a Fortran project open in order to get Fortran source coloring. I've discussed this with the VS integration developers before but will do so again.

I tried scenario 2 and it worked for me. Thought I had also done #3 but will try it again. There may be some limits to how smoothly we can make all this work for atypical cases, especially when a project is not open.
0 Kudos
abhimodak
New Contributor I
1,503 Views
Hi Steve

I appreciate you trying all these scenarios. # 3 is not serious but # 2 is. It is also connected to the fact that an exe generated (created) at command line and then loaded in Visual Studio to create a solution (starting with Update 6) has difficulties when the corresponding source files are simply drag-n-dropped in the VS. (I had mentioned this type of usage in my previous post on comments on editor enhancements.)

Considering that scenarios # 2 is not reproducible at your end, can this be an integration issue? I have now noticed that although I have update 5 and 11.1.060 installed (i.e. I can see them through Control panel --> Programs) both are not available in VS2005 and VS2010 through Tools --> Options --> IVF --> Compilers --> Selected Compiler. Only update 6 is available. I am going to read the release notes of update 6 again and also try to redo the integrations.

Abhi
0 Kudos
Steven_L_Intel1
Employee
1,503 Views
I can now reproduce #2 and will report it along with #1. However, I find it affects VS2010 only and then only when the file is not part of a project. If the file is part of an open Fortran project, the coloring is there. Issue ID is DPD200173541. I also passed along your observation #3.
0 Kudos
Steven_L_Intel1
Employee
1,503 Views
This has been fixed for a future update (probably Update 8.)
0 Kudos
Steven_L_Intel1
Employee
1,503 Views
... for small values of 8. It is fixed in Update 7.
0 Kudos
Reply