Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag –show_documentSymbols for lsp symbol lookup #864

Merged
merged 6 commits into from
Aug 2, 2022

Conversation

ankitaS11
Copy link
Collaborator

This PR adds a flag --show-errors which prints the diagnostics from the file to the console. This is used by VSCode Language Server extension to catch the stdout and parse into JSON,

Steps to test it -

  1. Clone https://github.com/ankitaS11/lpython and check out the lsp/add_flag/show-error branch.
  2. Compile lpython with LSP flag on:
conda activate lp # or use your environment name here
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=yes -DWITH_STACKTRACE=yes -DWITH_LFORTRAN_BINARY_MODFILES=no -DWITH_LSP=yes .
cmake --build . -j16
  1. To get the errors/ warnings (if any) for the given file path in JSON format: run ./src/bin/lpython --show-documentSymbols <file_name> in terminal. This will be used by LPython’s VSCode extension for document symbol lookup feature.

To Test it in VSCode extension -

Clone LPython’s VSCode Extension: https://github.com/ankitaS11/lpyth and follow the instructions mentioned in its README.

NOTE: This can only be tested once #863 gets merged.

src/bin/lpython.cpp Outdated Show resolved Hide resolved
Co-authored-by: Ondřej Čertík <ondrej@certik.us>
src/bin/lpython.cpp Outdated Show resolved Hide resolved
src/bin/lpython.cpp Outdated Show resolved Hide resolved
ankitaS11 and others added 2 commits August 2, 2022 14:05
Co-authored-by: Ondřej Čertík <ondrej@certik.us>
Co-authored-by: Ondřej Čertík <ondrej@certik.us>
src/bin/lpython.cpp Outdated Show resolved Hide resolved
@certik certik enabled auto-merge (squash) August 2, 2022 08:42
@certik certik merged commit 4eb75e6 into lcompilers:main Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants