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

Fix getCurrentDirectory calls in ghcide #1897

Merged
merged 4 commits into from Jun 6, 2021

Conversation

pepeiborra
Copy link
Collaborator

lsp HEAD no longer sets the current directory to the workspace root (haskell/lsp#326) so we need to remove this assumption from the ghcide codebase. There are 3 places where this is relevant:

  1. In the call to loadCradle, or rather, in the GHC session returned by it, where any relative paths in the flags returned by the cradle will expect to be resolved from the directory where the hie.yaml file lives - should change the working directory to the hie.yaml location
  2. In the logic to setInitialDynFlags, where we search for a hie.yaml file in the current directory - should use the workspace root instead
  3. In the LSP initialisation handler, where the current directory is included in the hiedb cache dir hash - should use the workspace root instead

@pepeiborra
Copy link
Collaborator Author

#1894 is open to test these changes with lsp HEAD

Copy link
Collaborator

@berberman berberman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ghcide/src/Development/IDE/Main.hs Outdated Show resolved Hide resolved
@pepeiborra pepeiborra force-pushed the fix-getCurrentDirectory-calls branch from f8531df to 6bd3338 Compare June 6, 2021 17:19
@pepeiborra pepeiborra force-pushed the fix-getCurrentDirectory-calls branch from 6bd3338 to f5bc01a Compare June 6, 2021 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants