Skip to content

Class plugin fails to parse Command Arguments #2993

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
drsooch opened this issue Jun 27, 2022 · 7 comments
Closed

Class plugin fails to parse Command Arguments #2993

drsooch opened this issue Jun 27, 2022 · 7 comments
Labels
component: hls-class-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@drsooch
Copy link
Collaborator

drsooch commented Jun 27, 2022

Your environment

Steps to reproduce

In Development.IDE.Types.Logger adding:

instance Pretty ResponseError where

And attempting to generate the class method (with no signature) results in:

(error "error while parsing args for classplugin.codeaction in plugin class: expected Bool, but encountered Null
arg = Object (fromList [(\"methodGroup\",Array [Array [String \"pretty\",String \"pretty :: ResponseError -> Doc ann\"]]),(\"range\",Object (fromList [(\"end\",Object (fromList [(\"character\",Number 29.0),(\"line\",Number 371.0)])),(\"start\",Object (fromList [(\"character\",Number 9.0),(\"line\",Number 371.0)]))])),(\"uri\",String \"file://~/redacted/haskell-language-server/ghcide/src/Development/IDE/Types/Logger.hs\"),(\"withSig\",Null)])")

FYI: this is part of log-response-errors branch so it is not in master so this will not be seen.

Expected behaviour

The generated class method to be shown

Include debug information

GHC-9.0.2 - HLS built from master (with minor changes to log messages)

@drsooch drsooch added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. component: hls-class-plugin Low Priority labels Jun 27, 2022
@Ailrun
Copy link
Member

Ailrun commented Jun 28, 2022

@July541, could you check this? It sounds like introduced in #2920.

@July541
Copy link
Collaborator

July541 commented Jun 28, 2022

@drsooch I built your log-response-errors branch with ghc-9.0.2 but cant repro your error. Did I miss something?

@drsooch
Copy link
Collaborator Author

drsooch commented Jun 28, 2022

@drsooch I built your log-response-errors branch with ghc-9.0.2 but cant repro your error. Did I miss something?

Can you add the instance declaration to the bottom of the file? That's where I saw the issue.

@July541
Copy link
Collaborator

July541 commented Jun 28, 2022

Can you add the instance declaration to the bottom of the file? That's where I saw the issue.

Looks fine.

instance Pretty ResponseError where  pretty = _

I just noticed this #2998, but your error message seems not possible, not sure how the type miss-match happened...

@drsooch
Copy link
Collaborator Author

drsooch commented Jun 28, 2022

Hmm, seems like it's a client issue... Can't reproduce in VSCode. Will close?

@July541
Copy link
Collaborator

July541 commented Jun 28, 2022

Aha, change to raise a lsp client bug?

@Ailrun
Copy link
Member

Ailrun commented Jun 28, 2022

Close this as not reproduced in other editors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-class-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants