ghcide does not recognize the DerivingVia extension

Created on 11 Jun 2020  路  14Comments  路  Source: haskell/ghcide

It does not show up during completion.

bug

All 14 comments

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

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

maybe @ndmitchell could help with

@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.

It works for completions for me.

image

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

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.

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.

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.

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 #380. I may be missing some context here.

Oops, I meant github.com/haskell/haskell-language-server/issues/380

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

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 https://github.com/emacs-lsp/lsp-haskell/issues/95 on emacs-lsp. Depending on the resolution we can close this issue.

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

closing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

googleson78 picture googleson78  路  9Comments

ndmitchell picture ndmitchell  路  3Comments

emilypi picture emilypi  路  8Comments

pepeiborra picture pepeiborra  路  9Comments

bubba picture bubba  路  4Comments