Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29390 ディスカッション

How to customize indenting in the Visual Studio Editor

jean-vezina
ビギナー
3,566件の閲覧回数

 

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 件の賞賛
6 返答(返信)
Steve_Lionel
名誉コントリビューター III
3,566件の閲覧回数

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
ビギナー
3,566件の閲覧回数

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

jean-vezina
ビギナー
3,566件の閲覧回数

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_H_Intel
モデレーター
3,566件の閲覧回数

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

jean-vezina
ビギナー
3,566件の閲覧回数

Request done!

Best regards,

Jean

willem_v_
ビギナー
3,566件の閲覧回数

Have a look at findent.sourceforge.net

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

返信