haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Jumping to definition in beam-core from beam-sqlite results in errors.

Open amano-kenji opened this issue 2 years ago • 1 comments

Your environment

Which OS do you use? Gentoo Linux

Which version of GHC do you use and how did you install it? 9.0.2 from Gentoo Linux

How is your project built (alternative: link to the project)? https://github.com/haskell-beam/beam

Which LSP client (editor/plugin) do you use? nvim-lspconfig

Which version of HLS do you use and how did you install it? 1.9.0.0 from Gentoo Linux

Have you configured HLS in any way (especially: a hie.yaml file)? hie.yaml

cradle:
  cabal:

Steps to reproduce

  • Open beam-sqlite/Database/Beam/Sqlite/Syntax.hs in neovim with nvim-lspconfig
  • Find IsSql99DataTypeSyntax in Syntax.hs
  • Jump to definition of IsSql99DataTypeSyntax in beam-core
  • Come back to Syntax.hs of beam-sqlite by pressing Ctrl+O
  • You can see errors in Syntax.hs
  • Find IsSql92DdlCommandSyntax in Syntax.hs
  • Jump to definition of IsSql92DdlCommandSyntax in beam-migrate
  • Come back to Syntax.hs of beam-sqlite by pressing Ctrl+O
  • The errors are gone.

Expected behaviour

No error

Actual behaviour

Diagnostics:
1. • No instance for (Database.Beam.Backend.SQL.SQL92.IsSql92TableNameSyntax
                        SqliteTableNameSyntax)
       arising from the superclasses of an instance declaration
   • In the instance declaration for
       ‘IsSql92DropTableSyntax SqliteDropTableSyntax’

and various other errors.

I can avoid the error by visiting beam-migrate from beam-sqlite before visiting beam-core from beam-sqlite. If I visited beam-core from beam-sqlite, then the errors can be eliminated by visiting beam-migrate from beam-sqlite.

amano-kenji avatar Jan 07 '23 09:01 amano-kenji

This is caused by our custom support for multiple home units and might be fixed eventually if #3502 together with some other PRs lands.

fendor avatar Feb 22 '23 12:02 fendor

This should be fixed with the new multi-component support.

michaelpj avatar May 15 '24 13:05 michaelpj