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

How do you use (un)folding? #418

Closed
googleson78 opened this issue Sep 20, 2020 · 8 comments · Fixed by #424
Closed

How do you use (un)folding? #418

googleson78 opened this issue Sep 20, 2020 · 8 comments · Fixed by #424
Labels
component: hls-retrie-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@googleson78
Copy link
Contributor

For this single file, with an implicit cradle

x = 3

y = x

These code actions on x

  refactor.extract: Fold x in current file
  refactor.extract: Fold x
  refactor.inline: Unfold x in current file
  refactor.inline: Unfold x

appear to not do anything.

Am I supposed to also install a retrie binary or something similar? I'm using LanguageClient-neovim.

@pepeiborra
Copy link
Collaborator

No need for a retrie binary, if the file typechecks it should rewrite to y=3. There may be a bug where the rewrite uses the file on disk, so you may need to save it first.

@googleson78
Copy link
Contributor Author

googleson78 commented Sep 20, 2020

It is saved. Does this log help?
hls-log.txt
gist
It seems to be some path related issue?

2020-09-20 23:48:44.036543404 [ThreadId 5] - ---> {"jsonrpc":"2.0","error":{"code":-32603,"message":"invalid value: string \"/tmp/asdf.hs\", expected relative URL without a base"},"id":2}
2020-09-20 23:48:44.036704076 [ThreadId 5] - haskell-lsp:Got reply message:"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32603,\"message\":\"invalid value: string \\\"/tmp/asdf.hs\\\", expected relative URL without a base\"},\"id\":2}"

@jneira jneira added component: hls-retrie-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Sep 20, 2020
@pepeiborra
Copy link
Collaborator

Yes, that helps.
I have pushed a potential fix to #408
Please test and let me know

@googleson78
Copy link
Contributor Author

Still doesn't work
Version (hash matches that of the branch):

blademaster :: /tmp » haskell-language-server --version
haskell-language-server version: 0.4.0.0 (GHC: 8.6.5) (PATH: /home/googleson78/.local/bin/haskell-language-server) (GIT hash: e233ad5c10ca8de4c2624167104b6d9d297b1c8e)

Log again - https://gist.github.com/googleson78/b5e811e3351b1459f58c37338d9925ff

@pepeiborra
Copy link
Collaborator

I've pushed another fix, give it another go when you can.

@googleson78
Copy link
Contributor Author

Do you mean from master? Trying from current master (e390da5) gives the same error in the log.

@pepeiborra
Copy link
Collaborator

#424

@googleson78
Copy link
Contributor Author

Thanks, works from that branch!

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

Successfully merging a pull request may close this issue.

3 participants