Skip to content
Snippets Groups Projects

[#2094] Add documentation to LSP hovers

Merged Sorokin-Anton requested to merge Sorokin-Anton/#2094-comments-in-ast into dev

Motivation and Context

We want to save comments in AST to show documentation on hover.

Related issues

Resolves none .

Part of #2094

:white_check_mark: 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

To do this we're inserting [@comment "..."] attributes during a lexer self-pass.

Adopt Nanopasses.Trivial.To_core. so it allows such attributes everywhere and saves them to Ast where needed.

Adopt scopes definition pass so it remembers attributes.

Obtain attributes of a hovered object, if needed add a markdown for this comment to the returned list of hovers.

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

Now we show documentation comments (like (** *) in CameLIGO and /** */ in JsLIGO) in LSP hovers

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 Sorokin-Anton

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Sorokin-Anton added 1 commit

    added 1 commit

    • d9d534bb - CameLIGO : use with_comments in parser

    Compare with previous version

  • Sorokin-Anton marked this merge request as draft from 88873981

    marked this merge request as draft from 88873981

  • Sorokin-Anton requested review from @Sorokin-Anton

    requested review from @Sorokin-Anton

  • Sorokin-Anton removed review request for @Sorokin-Anton

    removed review request for @Sorokin-Anton

  • Sorokin-Anton added 1 commit

    added 1 commit

    Compare with previous version

  • Sorokin-Anton resolved all threads

    resolved all threads

  • Sorokin-Anton added 1 commit

    added 1 commit

    Compare with previous version

  • Sorokin-Anton mentioned in merge request !2993 (merged)

    mentioned in merge request !2993 (merged)

  • Sorokin-Anton added 1 commit

    added 1 commit

    Compare with previous version

  • Sorokin-Anton added 1 commit

    added 1 commit

    • 7e7c80d5 - Comments -> attributes lexer self pass for JsLIGO

    Compare with previous version

  • Sorokin-Anton added 3 commits

    added 3 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading