Skip to content

Turn HLS-Wrapper into an LSP Server #2589

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
fendor opened this issue Jan 14, 2022 · 1 comment · Fixed by #2960
Closed

Turn HLS-Wrapper into an LSP Server #2589

fendor opened this issue Jan 14, 2022 · 1 comment · Fixed by #2960
Labels
component: cli About the pure command line interface of the hls executable Hackathon This issue is suitable for hackathon sessions type: enhancement New feature or request

Comments

@fendor
Copy link
Collaborator

fendor commented Jan 14, 2022

Is your feature request related to a problem? Please describe.

When hls-wrapper realises it is going to fail for one of the following reasons:

  • It can't figure out which GHC Version it needs
  • It can not find a fitting HLS version for the project's GHC version

Then hls-wrapper writes something to stderr and crashes. This is bad UX as users are often not aware about the stderr output and if they are, have a hard time to read the output.

Describe the solution you'd like

hls-wrapper should realise it is going to fail and become the LSP - Server to report to the client that we failed to launch. It can present the user a reasonable error message in combination with help instructions.

Describe alternatives you've considered

I was unable to come up with a better idea.

Maybe it is enough to send some json messages directly to stdout instead of a full-fledged lsp dependency.

@michaelpj
Copy link
Collaborator

Until the server has responded to the initialize request with an InitializeResult, the client must not send any additional requests or notifications to the server. In addition the server is not allowed to send any requests or notifications to the client until it has responded with an InitializeResult, with the exception that during the initialize request the server is allowed to send the notifications window/showMessage, window/logMessage and telemetry/event as well as the window/showMessageRequest request to the client.

So I think we could get away with sending a showMessage immediately, and we could probably hardcode the JSON for it indeed, rather than depending on lsp.

@jneira jneira added component: cli About the pure command line interface of the hls executable good first issue and removed status: needs triage labels Jan 14, 2022
@fendor fendor added the Hackathon This issue is suitable for hackathon sessions label Jun 11, 2022
@mergify mergify bot closed this as completed in #2960 Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: cli About the pure command line interface of the hls executable Hackathon This issue is suitable for hackathon sessions type: enhancement New feature or request
Projects
None yet
3 participants