Skip to content

[psc-ide] Cache last rebuild#2058

Closed
kritzcreek wants to merge 25 commits intopurescript:masterfrom
kritzcreek:cache-last-rebuild
Closed

[psc-ide] Cache last rebuild#2058
kritzcreek wants to merge 25 commits intopurescript:masterfrom
kritzcreek:cache-last-rebuild

Conversation

@kritzcreek
Copy link
Copy Markdown
Member

@kritzcreek kritzcreek commented Apr 27, 2016

This is supposed to allow us to access private values of a module for completions inside that module.

If we recently rebuilt the module in question we can cache a version that opens up the exports for the module.

This is still very much a work in progress but I just put it into a PR to gather early feedback or ideas. This would also be a way to attack the issue outlined in #1620

@kritzcreek kritzcreek changed the title [WIP][psc-ide] Cache last rebuild [psc-ide] Cache last rebuild Apr 27, 2016
@kritzcreek
Copy link
Copy Markdown
Member Author

Works fine for my few minimal testcases. Too bad hackage is down right now... If we were using stack for the builds we'd be fine.... just saying :D

@kritzcreek
Copy link
Copy Markdown
Member Author

Not really sure why the CI failed but it might be related to the hackage outage we had a few days ago. The one thing I'd really like to figure out for this PR is when to invalidate the rebuild cache. I'd like to minimize the amount of false positives we give.

@kritzcreek
Copy link
Copy Markdown
Member Author

retriggering the build

@kritzcreek kritzcreek closed this Apr 30, 2016
@kritzcreek kritzcreek reopened this Apr 30, 2016
paf31 and others added 4 commits April 30, 2016 14:59
Make as-patterns bind less tightly
* The current usage of psc-ide involves loading all modules anyway, so
  we don't worry about loading previously unloaded modules.

* Don't attempt to reload deleted files
@kritzcreek
Copy link
Copy Markdown
Member Author

I'd like to get some input on this.

I'm not sure about the API. Basically after every successful rebuild, we have the chance to recompile the module with open exports and store it inside the server, so it can be used for autocompletion and type lookup. This will also add an optional module field to the completion and type commands.

But we could also write the externs file, js file, and foreign file that we get this way to some point on the filesystem, and enable people to write unit tests for functions that are not exported by requiring these files.

While writing this I realised that this is not specific to psc-ide either and we could do the same with a normal compiler run. We can however only do it for one module at a time, because opening up/removing export lists will remove reexports and might cause nameclashes in modules that depend on the opened module, but looking at the speed of rebuilds this should be a tolerable overhead.

@kritzcreek
Copy link
Copy Markdown
Member Author

Okay after talking about this with @hdgarrood and @nwolverson I agree that writing anything to disc that potentially allows accessing private module members is way out of scope of this PR so I'd say this is a topic for another day.

I think this is ready for review. If you can think of a way to make reviewing changes like this easier let me know. I can offer to implement the functionality in my psc-ide-emacs fork but I don't think anyone but me is using emacs?

garyb and others added 3 commits May 1, 2016 22:45
* Update for names in new prelude
* Disable psci tests that rely on re-exports
* Use bower rather than git submodule for support dependencies
* Expose missing type declaration suggestion

* Tighten span for type wildcard warnings
garyb and others added 8 commits May 1, 2016 23:52
Also add comment explaining what the list actually does
Update the support modules list in the tests
adds module field to complete command
* Adds documentation for all the functions

* Breaks out pure parts for all the stateful functions, to minify the
  time spent in STM and improve testability
Implements something like the Builder Pattern
@kritzcreek kritzcreek force-pushed the cache-last-rebuild branch from a5b69fc to 6732395 Compare May 2, 2016 09:06
@kritzcreek
Copy link
Copy Markdown
Member Author

see #2083

@kritzcreek kritzcreek closed this May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants