Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
30 Views

How to customize indenting in the Visual Studio Editor

 

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
Highlighted
Black Belt Retired Employee
30 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.

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
30 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
Highlighted
Beginner
30 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
Highlighted
Moderator
30 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

Devorah - Intel® Developer Support
0 Kudos
Highlighted
Beginner
30 Views

Request done!

Best regards,

Jean

0 Kudos
Highlighted
Beginner
30 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