Skip to content

ghcide does not recognize the DerivingVia extension #746

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
poscat0x04 opened this issue Jun 11, 2020 · 14 comments
Closed

ghcide does not recognize the DerivingVia extension #746

poscat0x04 opened this issue Jun 11, 2020 · 14 comments
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@poscat0x04
Copy link

It does not show up during completion.

@poscat0x04 poscat0x04 changed the title ghcide does not recognize DerivingVia extension ghcide does not recognize the DerivingVia extension Jun 11, 2020
@poscat0x04
Copy link
Author

It's not just DerivingVia, a couple more extensions, such as QuasiQuotes, also suffer from this problem.

@gdevanla
Copy link
Contributor

Can someone elaborate a little more on what the behavior is supposed to be?

@jneira
Copy link
Member

jneira commented Nov 23, 2020

maybe @ndmitchell could help with

@jneira
Copy link
Member

jneira commented Nov 23, 2020

@gdevanla feel free to go into #haskell-ide-engine room in freenode irc (you can use https://kiwiirc.com/nextclient/ for example) and ask about hls, ghcide, haskell-lsp, etc topics. Not always is active but hopefully someone will answer sooner or later.

@ndmitchell
Copy link
Collaborator

It works for completions for me.

image

Windows, VS Code, I guess the latest HLS? (I don't even know how to tell...)

@gdevanla
Copy link
Contributor

gdevanla commented Dec 1, 2020

I am not able to see any completions on extensions using latest HLS and Emacs.

I think, since there is an diagnostic error, the completions is not getting triggered. Here is the screen shot of what I see.

extension_failure

Because of this error completions are not reevaluated and we only get completions from already cached results.

I am using Emacs, and master of hls/ghcide.

@gdevanla
Copy link
Contributor

gdevanla commented Dec 6, 2020

I feel like we could move {-# language and {-#options_ghc and any {-# completions out of cachedCompletions functions defined here. https://github.com/haskell/ghcide/blob/e24a744a06ee8807fd0a2c6b2db3f4eed0738372/src/Development/IDE/Plugin/Completions/Logic.hs#L564-L569

By moving it our into its own rule( outside NonLocalCompletions) we can show this completions, without encountering the parser error I am observing now. Is that approach acceptable? Are there any negative implication to that approach I should be aware of? If not, I will attempt to make that change.

@pepeiborra
Copy link
Collaborator

pepeiborra commented Dec 6, 2020

Yes, this goes in the right direction. My preference would be to decompose the completions code into multiple providers, which is exactly what the plugin model in haskell-language-server does.

Given that there is already a plugin to suggest pragmas in HLS, which at the moment it only provides code actions, I would support moving the completions code to that plugin, and at the same time take the chance to get rid of the code action in ghcide that does the same thing as reported in #380.

@gdevanla
Copy link
Contributor

gdevanla commented Dec 6, 2020

Thanks @pepeiborra . The plugin seems to be the perfect place to add this change. I will move the functionality there.

But, can you clarify how this is related to haskell/ghcide#380. I may be missing some context here.

@pepeiborra
Copy link
Collaborator

Oops, I meant github.com//issues/380

@poscat0x04
Copy link
Author

I'm pretty sure this issue no longer exists in version 0.6.0.0.

@gdevanla
Copy link
Contributor

gdevanla commented Dec 9, 2020

I have not been able to get this working with latest (master) hls/ghcide on Emacs. I need to dig deeper to see if this is an Emacs issue. Whenever, my cursor is inside the bounds of this text {-# #-}, I do not see any requests for 'textdocument/CodeCompletion' going out to the server at least in Emacs. If others feel this is only an Emacs issue than we can close this ticket.

For now, I am trying to reproduce this outside any editor. The HLS plugin currently does not have any tests, and many tests in HLS seemed to be commented out.

Update: I did confirm that this works fine on VS Code.

Update 2: I have logged an issue emacs-lsp/lsp-haskell#95 on emacs-lsp. Depending on the resolution we can close this issue.

@gdevanla
Copy link
Contributor

I fixed this issue with Emacs here. I think this issue can be closed.

@poscat0x04
Copy link
Author

closing

@pepeiborra pepeiborra transferred this issue from haskell/ghcide Dec 30, 2020
@jneira jneira added component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide 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

5 participants