Skip to content

Refactor selection range plugin #2996

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

Closed
kokobd opened this issue Jun 28, 2022 · 0 comments · Fixed by #3003
Closed

Refactor selection range plugin #2996

kokobd opened this issue Jun 28, 2022 · 0 comments · Fixed by #3003
Assignees
Labels
component: hls-code-range-plugin for code range related functionalities, such as selection range and folding range type: enhancement New feature or request

Comments

@kokobd
Copy link
Collaborator

kokobd commented Jun 28, 2022

Previously, hls-selection-range-plugin converts HieAST a (from ghc) to [SelectionRange] (from lsp). This design is very tight-coupled.

I'm planning to:

  • Extract a new data type CodeRange = CodeRange RealSrcSpan [CodeRange]
  • Split the process into two phases:
    1. Build CodeRange from HieAST a and comments (put this step in Rules)
    2. Derive [SelectionRange] from CodeRange (put this step in selection range lsp method handler)

I'll probably finish this in no more than two weeks. Then, "folding range" will simply become a use case of CodeRange. Adding it should be easier.

@sloorush Hope this will help your GSOC project (I'm assuming you have the same username on IRC and GitHub. Sorry if it's not the case). If you have any questions or advice, feel free to discuss them here or on the IRC channel.

@kokobd kokobd added the type: enhancement New feature or request label Jun 28, 2022
@kokobd kokobd self-assigned this Jun 28, 2022
@kokobd kokobd added the component: hls-code-range-plugin for code range related functionalities, such as selection range and folding range label Jun 29, 2022
@mergify mergify bot closed this as completed in #3003 Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-code-range-plugin for code range related functionalities, such as selection range and folding range type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant