Skip to content

Fix getCurrentDirectory calls in ghcide#1897

Merged
pepeiborra merged 4 commits into
masterfrom
fix-getCurrentDirectory-calls
Jun 6, 2021
Merged

Fix getCurrentDirectory calls in ghcide#1897
pepeiborra merged 4 commits into
masterfrom
fix-getCurrentDirectory-calls

Conversation

@pepeiborra

Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

#1894 is open to test these changes with lsp HEAD

@berberman berberman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread ghcide/src/Development/IDE/Main.hs Outdated
@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.

2 participants