hansec / ide-fortran

Fortran language support for Atom-IDE
MIT License
22 stars 1 forks source link

"No outline available: This is likely an error with the language package" #4

Closed boyoungzheng closed 6 years ago

boyoungzheng commented 6 years ago

I am trying to read Quantum Espresso code (http://qe-forge.org/gf/download/frsrelease/247/1132/qe-6.2.1.tar.gz) but no outline available. The console tab in opt+cmd+i gives a lot of following errors:

Uncaught (in promise) Error: 'ascii' codec can't decode byte 0xe2 in position 3384: ordinal not in range(128) at new ResponseError (/Users/me/.atom/packages/ide-fortran/node_modules/vscode-jsonrpc/lib/messages.js:46:28) at handleResponse (/Users/me/.atom/packages/ide-fortran/node_modules/vscode-jsonrpc/lib/main.js:430:48) at processMessageQueue (/Users/me/.atom/packages/ide-fortran/node_modules/vscode-jsonrpc/lib/main.js:258:17) at Immediate. (/Users/me/.atom/packages/ide-fortran/node_modules/vscode-jsonrpc/lib/main.js:242:13) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5)

macOS: 10.13.4 (17E199) Atom: 1.26.1 Electron: 1.7.11 Chrome: 58.0.3029.110 Node: 7.9.0 pip 10.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6) fortran-language-server: 0.3.4 atom-ide-ui: 0.11.1 ide-fortran: 0.1.5 language-fortran: 2.1.6

Thank you for your help!

hansec commented 6 years ago

Thanks for the report. This is actually an issue with the language server. It looks like you are running into an encoding issue (file format) with the files. However, I am unable to reproduce this issue myself with the linked version of Quantum Espresso. Can you please try running the language server in debug mode with the same root directory where you see the atom error and provide the output?

boyoungzheng commented 6 years ago

Thanks for the reply. Here is the result when I am in the root directory of QE (q-e-qe-6.2.1).

fortls --debug_rootpath .

Testing "initialize" request:
  Root = "."

  Succesful with errors:
    Parsing failed for file "././QHA/SRC/Ghost_DOS.f90"
    Parsing failed for file "././QHA/SRC/Partial_phonon_DOS.f90"
    Parsing failed for file "././QHA/SRC/atom_info.f90"
    Parsing failed for file "././PlotPhon/SRC/K_for_bands.f90"
    Parsing failed for file "././PlotPhon/SRC/Bands_to_gnuplot.f90"
    Parsing failed for file "././PlotPhon/SRC/E_min_max.f90"
    Parsing failed for file "././GWW/minpack/test.f90"
  Found module directories:
    ././PP/simple_transport/src
    ././PP/src
    ././PW/tools
    ././PW/src
    ././upftools
    ././upftools/HGH2QE
    ././EPW/tests/Inputs/t07
    ././EPW/src
    ././UtilXlib
    ././QHA/Phonon_DOS
    ././QHA/Debye
    ././QHA/SRC
    ././FFTXlib
    ././PHonon/Gamma
    ././PHonon/FD
    ././PHonon/PH
    ././XSpectra/src
    ././KS_Solvers/Davidson
    ././KS_Solvers/CG
    ././KS_Solvers/Davidson_RCI
    ././atomic/src
    ././LR_Modules
    ././PWCOND/src
    ././NEB/src
    ././CPV/src
    ././TDDFPT/tools
    ././TDDFPT/src
    ././PlotPhon/SRC
    ././GWW/minpack
    ././GWW/bse
    ././GWW/head
    ././GWW/pw4gww
    ././GWW/gww
    ././Modules
    ././LAXlib
    ././dft-d3
    ././COUPLE/examples
    ././COUPLE/src
hansec commented 6 years ago

Great, thanks. Unfortunately, the first 6 problematic files are not included in the source distribution. Maybe they are auto-generated during the build? I suspect one of those files has some characters that are outside the ASCII mappable character set, but I want to make sure that is the issue. Can you send me a copy of one or all of the those files?

The last problematic file is a different error that should not effect the functionality of the package in the way you described. I will work on a fix for that issue as well though

boyoungzheng commented 6 years ago

They should be included in the source distribution. QE can be downloaded from several websites. Maybe I misremember where I get my package. Anyway, here are those 6 the problematic files.

problematic.tar.gz

Actually, my main focus is about files in q-e-qe-6.2.1/PW/. But no matter what file I clicked in the project, I never got an outline. image

I also tested with a simple file, the outline worked even though the errors in console still exist. image

hansec commented 6 years ago

Ok, it looks like the parsing errors reported in debug mode are not related to the main uncaught exception you are seeing. I have run into this issue recently on MacOS if I install fortls using python 3+. The issues only seem to arise in Atom even though everything runs fine when I try and debug it in the command line. This makes diagnosing things very difficult. I am trying to track down what causes this, I think it has something to do with the multiprocessing package in python partially using the system python. Can you try reinstalling fortls using the system python instead of 3.6?

Also, if you run into repeated parsing errors in folders that you are aren't interested in, you can exclude those folders from parsing.

hansec commented 6 years ago

I believe I was able to track down both of these issues. Try updating fortls (to version 0.3.5) and let me know if the issues persist. You should be able to use whichever version of Python you want.

boyoungzheng commented 6 years ago

Problem Solved

Thank you very much! You are talented.