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

fix(ocamllsp): workspace symbols fallback to _build folder #1097

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tatchi
Copy link
Collaborator

@tatchi tatchi commented May 16, 2023

It checks that the uri exist and otherwise fallback to the _build folder. This might be the case for generated files (that only exist in the _build folder.

Before:

Screen.Recording.2023-05-16.at.07.10.12.mov

After:

Screen.Recording.2023-05-16.at.07.09.33.mov

let sourcefile = Filename.concat root_uri fname in
let path =
if Fpath.exists (Fpath.of_string sourcefile) then sourcefile
else build_dir ^ "/" ^ fname
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably also verify that the uri in _build folder exist? And if not remove the entry ?

@coveralls
Copy link

coveralls commented May 16, 2023

Pull Request Test Coverage Report for Build 3735

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.002%) to 16.881%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ocaml-lsp-server/src/workspace_symbol.ml 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
ocaml-lsp-server/src/workspace_symbol.ml 1 0.0%
Totals Coverage Status
Change from base Build 3733: -0.002%
Covered Lines: 3934
Relevant Lines: 23304

💛 - Coveralls

@rgrinberg rgrinberg requested a review from 3Rafal May 18, 2023 08:13
@rgrinberg rgrinberg added this to the 1.16.0 milestone May 18, 2023
let sourcefile = Filename.concat root_uri fname in
let path =
if Fpath.exists (Fpath.of_string sourcefile) then sourcefile
else build_dir ^ "/" ^ fname
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if we use Fpath for path concatenation, instead of doing it by hand

@3Rafal
Copy link
Collaborator

3Rafal commented May 18, 2023

Pls add a changelog note

@rgrinberg rgrinberg requested a review from ddickstein May 30, 2023 12:55
@rgrinberg rgrinberg removed this from the 1.16.0 milestone Jun 15, 2023
@ddickstein ddickstein removed their request for review June 20, 2023 22:30
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

4 participants