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

How to customize indenting in the Visual Studio Editor

jean-vezina
Beginner
1,247 Views

 

Good afternoon,

Is there a way to customize the indenting style in the Visual Studio Fortran editor?

For example, if I do the Format Document in a test source file, I obtain the following formatting:

    module test
    contains
    integer function t(arg)
    integer,intent(in)::arg
    t=arg**2
    end function
    subroutine add(a,b,c)
    real a,b,c
    c=a+b
    end subroutine
    end module

I would like to have a layout where the module contents and procedure are indented like this:

 module test
    contains
    integer function t(arg)
       integer,intent(in)::arg
       t=arg**2
    end function
    subroutine add(a,b,c)
        real a,b,c
        c=a+b
    end subroutine
end module

Thanks in advance,

Jean

0 Kudos
6 Replies
Steve_Lionel
Honored Contributor III
1,247 Views

I had never tried Format Document before. I think it doesn't understand Fortran. If you type this code in using a keyboard, it will be indented much the way you want.

Under Tools > Options > Text Editor > Fortran > Tabs, you can control some of the editor's behavior.  It would be a nice Feature Request to see if the Format Document option (Edit > Advanced) could do indenting the way typing does.

jean-vezina
Beginner
1,247 Views

Good evening,

Format Document indents properly DO, IF, SELECT CASE, BLOCK, etc, and even type declarations. The only things it doesn't indent are module declarations and procedures. Perhaps an option could be added if somebody doesn't want excess indentation.

Regards,

Jean

0 Kudos
jean-vezina
Beginner
1,247 Views

Good afternoon,

Just to reminder that I would like that a feature request be made to indent the contents of module contents and procedure and to add an option to enable or disable that feature.

Thanks in advance,

Best regards,

Jean

0 Kudos
Devorah_H_Intel
Moderator
1,247 Views

Thank you for your report! This feature request is better to be reported via our Online Service Center at https://supporttickets.intel.com/  
Instructions on how to file a ticket are available here: 
https://software.intel.com/en-us/articles/how-to-create-a-support-request-at-online-service-center  

jean-vezina wrote:

Good afternoon,

Just to reminder that I would like that a feature request be made to indent the contents of module contents and procedure and to add an option to enable or disable that feature.

Thanks in advance,

Best regards,

Jean

0 Kudos
jean-vezina
Beginner
1,247 Views

Request done!

Best regards,

Jean

0 Kudos
willem_v_
Beginner
1,247 Views

Have a look at findent.sourceforge.net

findent does not integrate with visual studio, but maybe it can solve part of your problems.

0 Kudos
Reply