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

Implementation of the Hover feature #20

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

osman362
Copy link
Contributor

@osman362 osman362 commented Mar 1, 2024

The Goal

This pull request introduces the hover information functionality of the Language Server Protocol for Modelica. The goal of this feature is to provide users with detailed information about Modelica classes, including descriptions, inputs, outputs, and parameters, directly within the hover pop-up interface.

Implementation Details

  • Hover Information Extraction: I developed utility functions that are extracting relevant information for classes, inputs, outputs, and parameters. This involved navigating the AST to identify description_string nodes for descriptions and component_clause nodes and their children checking if they include the keywords input, output, parameter (as we can't differentiate these in the AST) for declarations.
  • Markdown Formatting: The extracted information is presented in a readable and structured format by using Markdown. This includes the class description, inputs, outputs, and parameters, each formatted within blocks for clarity.

What Follows Next

  • Unit Testing: Integration of unit tests to ensure the reliability and correctness of the implemented hover information feature.
  • Additional Features: Including more detailed documentation, examples of usage, or references to Modelica documentation.

osman362 and others added 7 commits February 23, 2024 21:20
- onHover method recognizes comments above a function and shows the content inside the hover information
- output.md file is a reference on how the hover information should look like
- step.mo is a test fixture for the hover method
@AnHeuermann
Copy link
Member

The basics are working now.
The only remaining thing I would like to add is the ability to find definitions with fully qualified names.

E.g. from the DrumBoilder example I would like to get velocityOfSound_ph documentation in every location.

@AnHeuermann AnHeuermann marked this pull request as draft March 8, 2024 16:24
@AnHeuermann AnHeuermann linked an issue May 23, 2024 that may be closed by this pull request
3 tasks
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.

Implement Hover Request
2 participants