Skip to content

[#1920] Prevent diags from other files to be shown

Motivation and Context

Related issues

Resolves #1920 (closed).

Checklist for the LIGO Language Server

  • I checked whether I need to update the README.md file for the plugin and did so if necessary:
    • If I implemented a new LSP request, I added it to the list of supported features that may be disabled
    • If I implemented a new LSP method, I added it to the list of supported functionality
  • I checked that my changes work in Emacs, Vim, and Visual Studio Code
  • (Before merging) The commit history is squashed and prettified, and follows the Serokell commit policy, or the MR is set to squash the commits

Description

Filter diagnostics so that files that don't match the current Path.t are stripped away. Note that, for errors, locations are optional. I made it so that those are stripped away as well, which might not be desirable. The reasoning was that it was difficult to figure out if those also came from another file or the current one, so I preferred to strip them.

Save the path of the diagnostics, as well as its range. Partition them so they may be sent individually for each file. Refactor the handlers a bit so we are able to check these changes in our test suite.

On a side note, let_ppx is enabled now.

Component

  • compiler
  • website
  • webide
  • vscode-plugin
  • debugger

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)

Changelog

Fixed an issue causing diagnostics from other files to be incorrectly shown in the current file.

Checklist:

  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by Heitor Toledo Lassarote de Paula

Merge request reports