hansec / vscode-fortran-ls

Fortran IntelliSense for Visual Studio Code
MIT License
37 stars 7 forks source link

Does Fortran IntelliSense works well in Linux? #9

Closed Flobbidinous closed 5 years ago

Flobbidinous commented 5 years ago

When I use FORTRAN IntelliSense in Linux Mint, it seems does not work. So I want to know does FORTRAN IntelliSense could work in Linux?

I will be looking forward to your reply. Thanks.

PS: I can use it normally under Windows

hansec commented 5 years ago

Yes, it should work just fine on Linux. Are you getting any errors?

Flobbidinous commented 5 years ago

I think I have installed fortran-language-server correctly. And fortls can be seen in /home/raphael/.local/bin. Also, I have set "fortran-ls.executablePath": "/home/raphael/.local/bin/fortls", but IntelliSense is still not work. I am so confused now, could you help me ? Thanks for your help. Have a nice day.

Flobbidinous commented 5 years ago

On Windows, I can find fortls.exe. But on linux, I can only find a python file fortls, is there a problem here?

hansec commented 5 years ago

On linux there is no extension for executables so fortls is the correct file. Are you getting an error from VSCode that the language server cannot be launched or are you just not getting results from the server as expected?

Flobbidinous commented 5 years ago

I didn’t get any error message or warning,FortranIntellisense did not working at all,everything is same as when Intellisense was not installed.

hansec commented 5 years ago

Hmmm, that is strange. You should get a warning or error if the language server cannot be found or is not working. Can you try setting "fortran-ls.executablePath" to an intentionally incorrect path, say /home/raphael/.local/bin/fortlssss, and see if you get an error when you restart VSCode and open a fortran file?

Also, you are working on a set of Fortran files that work correctly on Windows, right?

Flobbidinous commented 5 years ago

Yeah,I use it in a same project,it is true that work correctly on WIndows. I will try according to your suggestion,but now I am not in my office,I will get back to you later. Thanks for your help.

Flobbidinous commented 5 years ago

Hi, I tried to follow your advice, but I still didn't have any messages. Also, I tried to delete settings.json, same as before, didn't has any messages. After that, I tried reinstall Fortran Intellisense, I didn't got any messages either.

Later, I tried to copy fortls to usr/local/bin, and I try to run fortls in terminal, it worked. But in VSC, it still didn't work.

In each of the above steps, I restarted VSC.

hansec commented 5 years ago

You should be getting error messages if the language server cannot be launched. So the lack of error messages indicates that for some reason files are not triggering start of the language server. Which fortran language package do you have installed (Modern Fortran or fortran)?

Flobbidinous commented 5 years ago

modern fortran,the latest one.

hansec commented 5 years ago

That is very strange. I will try and spin up a Mint VM in the next few days and see if I can reproduce the problem. What version of Mint are you using?

Flobbidinous commented 5 years ago

My Linux version is Mint 19 Tara \n \1.

Python version is 2.7.15rc1, here is how I install fortran-language-server:

  1. sudo apt install python-pip
  2. pip install setuptools
  3. pip install fortran-language-server

On VSC, I have installed C/C++ 0.22.1;CMake 0.0.17; CMake Tools 1.1.3; Fortran Breakpoint support 0.0.4; Fortran intellisense 0.4.0; Modern Fortran 2.1.0; Python 2019.3.6215.

hansec commented 5 years ago

Unfortunately, I am not able to reproduce this issue. I installed the same version of Mint linux, with the packages listed above, and everything appears to work just fine. The language server provides the expected results and if I provide the wrong path to fortls it gives the expected error when I open a Fortran file. I don't really know what could be causing the issues you describe, but the absence of an error with the wrong path to fortls indicates the extension isn't working properly. I would recommend uninstalling VSCode and reinstalling it and the extensions in case the extension got corrupted somehow on install. Sorry I can't provide any more insights.

Flobbidinous commented 5 years ago

Thanks for your help.

hansec commented 5 years ago

Were you able to find a solution?