vscode-fortran-support icon indicating copy to clipboard operation
vscode-fortran-support copied to clipboard

[FEAT] Add lfortran as linter

Open gnikit opened this issue 1 year ago • 3 comments

Is there an existing request for this?

  • [X] I have searched the existing issues

Feature Request

Add lfortran as an available linter in vscode-fortran. We want to use the ASR of lfortran and capture it's diagnostic output. The current limitation is having a standardised plain-text output which can be captured into a vscode.Diagnostic object. I need to implement that in lfortran first.

CC @certik

gnikit avatar Jul 29 '22 10:07 gnikit

I implemented it here: https://github.com/lfortran/lfortran/pull/47

I think printing it as JSON would be easier, we can implement it next, just let me know.

certik avatar Jul 29 '22 20:07 certik

I implemented it here: lfortran/lfortran#47

I think printing it as JSON would be easier, we can implement it next, just let me know.

Thanks for the quick implementation. I think so too, JSON is inheretly easier to parse in Typescript but I was unsure if the JSON creation has made it into lfortran yet.

The info that we need is: start_line, start_col, end_line, end_col and message. see VSCode API: https://code.visualstudio.com/api/references/vscode-api#Diagnostic

Also, do you think we can do a minor conda release, when this is done, so users can download lfortran with conda?

gnikit avatar Jul 30 '22 11:07 gnikit

Ok, we can do JSON as well. Yes we should make a conda release. There is an issue (https://gitlab.com/lfortran/lfortran/-/issues/743) that interactive mode does not work with LLVM 14 yet, and Conda does not have LLVM 11 anymore I think. I'll fix it soon.

certik avatar Jul 30 '22 14:07 certik