This repository has been archived by the owner on Jan 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Preserve more information about targets #820
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why not use `GHC.TargetId`?
…On Fri, 18 Sep, 2020, 03:45 Pepe Iborra, ***@***.***> wrote:
The problem we are trying to solve is accurately decide what modules
belong to a cradle when there are multiple projects sharing the same source
folder, and project membership is driven by a Bios cradle.
For instance, say we have modules A,B,C in the same folder, and A,B should
use the same set of flags whereas C should use a different set of flags.
For A or B, the Bios cradle will return the set of flags F1 and the targets
{A,B}. For C, the Bios cradle will return the set of flags F2 and the set
of targets {C}.
While editing A, when finding an import C, ghcide must not allow ghc to
load C, and instead must locate it in a package.
The improvement in this PR is to preserve more information from the set of
targets returned by the cradle. Targets can be either file paths, or
modules. Previously we would only store modules, inferring possible module
names from file paths, which is lossy and unnecessary. The change here is
to preserve either module names or file paths.
------------------------------
You can view, comment on, or merge this pull request online at:
#820
Commit Summary
- Preserve more information about targets
File Changes
- *M* session-loader/Development/IDE/Session.hs
<https://github.com/haskell/ghcide/pull/820/files#diff-83193bb2819f3fc589547e0414a805ee>
(38)
- *M* src/Development/IDE/Core/Rules.hs
<https://github.com/haskell/ghcide/pull/820/files#diff-b3c76360204f553be39aaf5ae07b8d67>
(8)
- *M* src/Development/IDE/Core/Shake.hs
<https://github.com/haskell/ghcide/pull/820/files#diff-9f3c72df87c6e40a0ab15d33001d156c>
(14)
Patch Links:
- https://github.com/haskell/ghcide/pull/820.patch
- https://github.com/haskell/ghcide/pull/820.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#820>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEW5USDVXHLNXGZWENT2GDSGKC6TANCNFSM4RRCS4EQ>
.
|
I wanted to, but the phase argument is redundant |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Can't we ignore the phase argument/set it to Nothing? |
We could. Why does it matter? |
Doesn't really, just seems a bit strange to redefine a type that GHC already provides. |
wz1000
approved these changes
Sep 18, 2020
wz1000
reviewed
Sep 18, 2020
This should prevent infinite looping on cradles that do not provide targets, such as the hie-bios implicit cradle (no longer used)
pepeiborra
added a commit
to pepeiborra/ghcide
that referenced
this pull request
Oct 5, 2020
* Preserve more information about targets * Correctly model the special target This should prevent infinite looping on cradles that do not provide targets, such as the hie-bios implicit cradle (no longer used)
pepeiborra
added a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
* Preserve more information about targets * Correctly model the special target This should prevent infinite looping on cradles that do not provide targets, such as the hie-bios implicit cradle (no longer used)
pepeiborra
added a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
* Preserve more information about targets * Correctly model the special target This should prevent infinite looping on cradles that do not provide targets, such as the hie-bios implicit cradle (no longer used)
pepeiborra
added a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
* Preserve more information about targets * Correctly model the special target This should prevent infinite looping on cradles that do not provide targets, such as the hie-bios implicit cradle (no longer used)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem we are trying to solve is accurately decide what modules belong to a cradle when there are multiple projects sharing the same source folder, and project membership is driven by a Bios cradle.
For instance, say we have modules A,B,C in the same folder, and A,B should use the same set of flags whereas C should use a different set of flags. For A or B, the Bios cradle will return the set of flags F1 and the targets {A,B}. For C, the Bios cradle will return the set of flags F2 and the set of targets {C}.
While editing A, when finding an
import C
, ghcide must not allow ghc to loadC
, and instead must locate it in a package.The improvement in this PR is to preserve more information from the set of targets returned by the cradle. Targets can be either file paths or modules. Previously we would only store modules, inferring possible module names from file paths targets which was lossy and unnecessary. The change here is to preserve either module names or file paths.