Closed
Description
Bug description
I'm using VS Code, with the ghcide extension.
When adding a package dependency to the package.yaml, I have to reload to entire VS Code window to restart ghcide to detect and load this new dependency in ghcide.
Desired behaviour
ghcide should reload the dependencies when packages.yaml is updated, so that I don't have to restart it manually.
Version
$ ghcide --version
ghcide version: 0.2.0 (GHC: 8.8.3) (PATH: /nix/store/sdn0dabqvc1g25s8grq7sa9g13ax8fk7-ghcide-exe-ghcide-0.2.0/bin/ghcide)
using Remote SSH extension for VS Code
vscode client on Windows 10
vscode server on NixOS 20.03
I use the ghcide-nix derivation to get GHCIDE (version was recently bumped there)
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
ndmitchell commentedon Jun 12, 2020
You can do "Restart extension host" to reload just the extensions, which is a bit less violent. Agreed that auto-reloading the right pieces would be desirable - I guess this is a
package.yaml
file that Stack transforms into amypackage.cabal
file?fendor commentedon Jun 12, 2020
I think that the stack cradle is watching for changes to
package.yaml
and should detect these changes.GuillaumeDesforges commentedon Jun 13, 2020
That was my understanding as well, but it doesn't.
fendor commentedon Jun 13, 2020
Is the project structure different to a basic
stack new
? Orhaskeleton
template?GuillaumeDesforges commentedon Jun 13, 2020
It is a stack project with multiple projects (in subdirectories), and one of the project is a classic component defined by a package.yaml
The hie.yaml defines multiple cradles for the projects, and the concerned cradle has a standard config (stack component)
fendor commentedon Jun 14, 2020
Maybe that is the problem, the dependencies ought to be relative to the
cradleRootDir
. Maybe they are not canonicalized in ghcide?https://github.com/digital-asset/ghcide/blob/master/exe/Main.hs#L271
Should probably make the filepaths relative to the cradleRootDir or make them even absolute.
fendor commentedon Jun 14, 2020
We actually need both, the dependencies could be relative to the
cradleRootDir
or tocomponentRootDir
e.g.We need to reload both components in case of change to
./servant/stack.yaml
but only one for changes to./servant/servant-server/servant-server.cabal
,./servant/servant-server/package.yaml
and./servant/servant-docs/servant-docs.cabal
,./servant/servant-docs/package.yaml
respectively.A proposed solution:
Change the API of cradle dependencies in hie-bios to give absolute paths since this is the only location where we can know this. (Another breaking change, yay)
Unfortunately, this does not play nicely with the latest breaking change to extend a CradleError with the dependencies of the component, since we dont know the component dir in that case :(
pepeiborra commentedon Dec 31, 2020
@fendor can this ticket be closed now?
[-]ghcide 0.2 does not detect new dependencies added to packages.yml[/-][+]hls does not detect new dependencies added to packages.yml[/+]jneira commentedon Jan 12, 2021
Recently this issue was noted in the irc channel by an user so i guess this is still an issue.
@fendor the plan could be still this?
GuillaumeDesforges commentedon Jan 12, 2021
I can confirm the issue still happens, I often restart the HLS manually.
jneira commentedon Aug 31, 2021
i think we can close it as duplicate of #1068