Allow ide module rebuilds without touching fs output/cache-db#4362
Closed
wclr wants to merge 3 commits intopurescript:masterfrom
Closed
Allow ide module rebuilds without touching fs output/cache-db#4362wclr wants to merge 3 commits intopurescript:masterfrom
wclr wants to merge 3 commits intopurescript:masterfrom
Conversation
Contributor
|
@wclr Could you add the change to the protocol here? Would also be great if anybody on the core team could review this. |
Contributor
|
If anybody would like to try this here's a build of the vscode extension: You can install it via cmd-shift-p "install from vsix". |
Comment on lines
+454
to
+458
| copyForeign path mn = | ||
| case makeOutputPath of | ||
| Nothing -> pure () | ||
| Just outputFilename -> | ||
| copyFile path (outputFilename mn "foreign.js") |
Contributor
There was a problem hiding this comment.
Isn't this traverse_ makeOutputPath \outputFileName -> copyFile path (outputFilename mn "foreign.js")?
Comment on lines
+78
to
+82
| & (if pureRebuild then shushCodegen else identity) | ||
| & ( if pureRebuild | ||
| then enableForeignCheck foreigns codegenTargets | ||
| else identity | ||
| ) |
Contributor
There was a problem hiding this comment.
Should these two if expressions be merged?
if pureRebuild then
enableForeignCheck foreigns codegenTargets . shushCodegen
else
identity
Contributor
|
This otherwise looks fine to me. |
Contributor
|
@wclr May I take this over and address @JordanMartinez 's comments? |
5 tasks
Contributor
Author
|
Sorry I missed this out a bit. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of the change
This PR allows ide rebuilds without involving the file system by directly sending module source code (instead of file path) and expecting that it will affect ide state, but not file system output (compiled source, externs, and cache-db.json).
This is needed to enable a more robust version of getting IDE diagnostics on type feature.
Summary of actual changes
src\Language\PureScript\Make\Actions.hs
added
ffiCodegen'exported function that allows performing FFI check with/without actual codegen (copying the foreign module to the output).src\Language\PureScript\Ide\Rebuild.hs
Added check if in place of file name to rebuild we got text
data:...expecting actual module source afterdata:prefix. If so, assume to make a "pure rebuild" i.e., without any file system codegen and modifyingcache-db.json.Prior work: #4178
Checklist: