Coder Social home page Coder Social logo

fortran-lang / vscode-fortran-support Goto Github PK

View Code? Open in Web Editor NEW
191.0 8.0 30.0 67.1 MB

Fortran language support for Visual Studio Code

Home Page: https://marketplace.visualstudio.com/items?itemName=fortran-lang.linter-gfortran

License: MIT License

TypeScript 82.94% Fortran 14.89% JavaScript 1.33% C 0.01% Shell 0.81% Makefile 0.02%
snippets debugger formatting fortls fortran language-server-client linter syntax-highlighter vscode-extension

vscode-fortran-support's People

Contributors

albertziegenhagel avatar chrisspyb avatar dependabot[bot] avatar deslaughter avatar emanspeaks avatar gnikit avatar han190 avatar hansec avatar implicitall avatar krvajal avatar ktomkeys avatar letmaik avatar lostintangent avatar machsix avatar notzaki avatar pedro-ricardo avatar ribombalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-fortran-support's Issues

Problem with syntax highlight

Something wrong with the syntax highlight:


screen shot 2018-07-04 at 7 28 31 pm

the angweight(ith, iphi) messed the syntax highlighting for the rest of the codes. If I delete the spaces on both sides of the "*" before the angweight(ith, iphi), then it works just fine (or adding a parentheses to wrap up the angweight also fix the problem)

Why I cannot run Fortran code with GFortran?

I have installed MinGW-w64 and set a path to environment variable.
But when I open a '.f90' file I cannot find a available environment to debug or run it.
Could you tell me the solution to me?

Thank you

How to disable the linter?

I am using Intel Fortran compiler because of error messages coming from the extension I would like to disable linter. Could you please to help with required settings?

Every variable is now colored

Last commit (#66) made all user variables on file to be highlighted. In fact every thing you type is now highlighted some how. Don't know if this was the intention... or is a collateral effect from openmp directives.

Fortran Symbols

Please complete the Fortran Symbols outlining!
There are open code in the net can be useful for this regards like Code::Blocks.

GoToFunction needed

I really really want to have the ability to navigate to the declaration of a function by Cmd+Click in any statement including that function call. Wanna anyone to work on that?

!$ syntax highlighting for Fortran module usage

Hey, you guys do awesome work. like seriously being able to code fortran in VSC is amazing. I just have one suggestion. When implementing !$ it comes out as a comment, anyways to change this so that is shows the module being called?

for example:

image

I am calling the omp_lib module, but it shows up as a comment

Customizable line width past 72 characters in Fixed Form

Description

In certain cases, some are shown below in the MWE, the syntax highlighting marks the 73rd character as a comment.

Request

Make the number of characters in a line that are coloured as input (and not comments) a user input variable.

MWE

C F77 MWE syntax highlighting breaking at line
      PROGRAM TEST

      integer :: i = 10
      ! Character 73 begins here -------------------------------------->
      print*, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i,
      print*, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i,i, i,
      print*, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, i,i,i, i

      print*, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
      print*, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,18, 19

      print*, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, (1), 18, 19
      print*, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 18, 19

      END PROGRAM TEST

Highlighting

Screenshot from 2021-09-21 09-26-10


Original Post

Hi,

I use fixed-form Fortran with 132 columns. Visual Studio already has a setting for increasing the line width, but none of the VScode Fortran extensions have it. Is it possible to add the line width as a variable that can be changed in the settings? Thanks!

PGI Fortran

Hi, thanks for your modern fortran extension. Do you have any advice on how to get PGI fortran working with your addin and vscode? Also, have you experienced any diffulculties with linking programs in the light of rowhammer, and what companies such as apple are doing to aslr and kaslr? Cheers!

Code Helper uses 100% CPU

Thanks for this incredibly helpful extension!

I have some issue when hovering over a variable. For folders with many files, instead of showing the documentation, the little pop up message just says "Loading..." and Code Helper uses 100% of my CPU.
This continues after closing Visual Studio Code and I have to force quit Code Helper to go back to normal CPU usage.

The only way to avoid this issue is to disable the extension. I would be happy if there's a fix for it, though. Maybe some setting that I am not aware of?

Visual Studio Code for Mac 1.19.1 with Modern Fortran 0.6.2 extension.

Subroutine arguments with more than one line

The subroutine and function dummy-arguments are not highlighted if inserted the like break symbol &.
A code like this:

subroutine something_large(igxw,igyw,igzw,nxw,nyw,nzw,&
                           igxaux,igyaux,igzaux,nxaux,&
                           nyaux,nzaux,sx,sy,sz,layers,a,b,ngc_aux)
    implicit none
        
        
end subroutine  something_large

Is highlighted like this:
sub_args

The highlight fix needs to be done for functions as well.

Linter can't find mod files in the current directory

First of all, thank you for creating and maintaining this extension.

I have to explicitly include directories with my mod files in settings.json, in my case like this:

    "fortran.includePaths": [
        "/home/certik/repos/hfsolver/src",
    ],

But my project has many subdirectories etc. I use cmake to manage it. Is there some better way to specify the paths for the linter? If not, is the intended usage that I will simply list all directories where one can find the .mod files my project specific settings for vscode?

Also, my project can be build both in tree and out of tree using cmake. In the out of tree build, the mod files will be at different location. Is there a solution to that?

Thanks for any tips.

Function keyword highlight

I noticed that the declaration: double precision function test(a,b) doesn't highlight correctly but is recognized as a symbol.

Symbol list uses 100% CPU

The code below freezes the extension when the Symbol List (Ctrl+Shift+O) command is used. The extension keeps running in the background with 100% CPU even after VScode is closed.

module symbol_test
    
    implicit none
    
contains
    
    subroutine Much_dummy_arguments(headlev, rhs, rho, rhof, mu, u, u1, v, v1, w, w1, sx, sy, sz, &
        kindv, crlx, rlx_down, rlx_up, shift, t, dt, alfa, theta, tol_vel, ap_simple)
        implicit none
        
    end subroutine Much_dummy_arguments
    
end module symbol_test

The screenshot below illustrates what is happening:
symb_err
After pressing Ctrl+Shift+O it is not possible to type anything, the editor freezes.
If you kill the code process that is using 100% CPU it is possible to type in editor once again, but the symbol list shows No symbol information for the file and the following window pops up:
err

update for fortran format

HI,thanks a lot for you working of this extend,may you consider add some fortran format,
I feel so tired to press Tab to make a space
for example:if(a>b) then
return 1
end if
there are some auto-space,I will be happy

Linting is no longer visible

I've been using the extension for a while and for some reason the linting stopped working.
The syntax highlight is working perfectly fine for me it's just that the errors are no longer underlined.

Compilation

What do i have to type in the user setting in order to being able to compile my code? I have typed in {"fortran.gfortranExecutable": "gfortran"} but it doesn't work, it says in the terminal it is an unknown command.

Cannot toggle comment in fortran_foxed-form

With the default command "toggle line comment", I can not toggle line comments for fixed format fortran files.

This is due to the "configuration" is missing for language id "fortran_fixed-form" in the "package.json".

If you add line

        "configuration": "./language-configuration.json"

after line 55 of file package.json, this problem will be resolved.

I am sorry that I am not familiar with github so that I can not prepare a pull request.

At last, thank you very much for your marvelous works on this extension!

Highlighting of module names

Would it be possible to add highlighting for the module and end module name such that it is the same as with the use command?
That would make it consistent with subroutine and call.

image

Include Paths

The documentation says that include paths can be controlled with the fortran.includePaths setting. But the example that is shown has the variable fortran.includePath (no final "s").

Support for "select type" construct

The Fortran 2003 feature "select type" which allows you to find the type of a polymorphic entity is not supported through syntax highlighting like "select case" is.

screen shot 2018-03-09 at 00 21 52

Add a FORTRAN formatter

An amazing implementation of FORTRAN editing.
A FORTRAN formatter would be very helpful enhancement (at least for the free format FORTRAN code file structure, FORTRAN 90 and up) .
Format document and format selected like in the c/c++ extension.

Build fails after lint correction

After PR #56 the command npm run lint exits with error.

npm ERR! Linux 4.4.76-1-default
npm ERR! argv "/usr/bin/node6" "/usr/bin/npm-default" "run" "lint"
npm ERR! node v6.12.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] lint: `node ./node_modules/tslint/bin/tslint ./src/**/*.ts `
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] lint script 'node ./node_modules/tslint/bin/tslint ./src/**/*.ts '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the linter-gfortran package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./node_modules/tslint/bin/tslint ./src/**/*.ts 
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs linter-gfortran
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls linter-gfortran
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/pedro/Softwares/fortran-vscode/npm-debug.log

In past master commit d0f2b04ce everything works fine.

poor syntax highlighting

Syntax highlighting is incomplete. E.g. call is not highlighted. Neither is program. This would be very useful to add.

Compiler options highlight seems wrong

When using compilation statements #ifdef, #if defined(), #else and #endif the code highlight the line with two different colors.
In the figure below the whole line should be blue, or some other color:
highlight

Symbol List uses 100% CPU

In large files the Symbol List (Ctrl-Shift-O) fails too, CPU goes to 100%, and VS-conde needs to be killed manually.
In this case i think it is because the extension mark as a symbol all declared variables and functions on the file, instead of only the keywords function, subroutine, program and module.
In my opinion, to take all variables as symbols isn't correct, but let's discuss this ...

Some Intrinsic functions are missing

The allocatable declaration statement isn't highlighted, as well as some Intrinsic functions like dsqrt and move_alloc. Logical statements like .and. , .or., >= and == are missing too. More examples in the figure below:
highlight3

If adding this keywords is as simple as adding names to a file, tell me the file i have to look at and i can do it if you want.

Support for Fortran 2008 block construct

Fortran 2008 added the block construct, which allows you to define local scoping units within the block, but these are not supported in the syntax highlighting

For example:
screen shot 2018-03-10 at 17 18 33

Else statement highlight

If a comment is added immediately after the else keyword, the comment is not highlighted properly and next line is highlighted as invalid. Picture below illustrate the error.
highlight

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.