-
Notifications
You must be signed in to change notification settings - Fork 17
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
Extended recommendations for large projects #127
Comments
Ah sub-directories are a bit tricky on vs-code. You're correct that without additional configuration it's attempting to search the top level workspace file for hiefiles, src files, etc. We will push an update that adds a yaml or json configuration to avoid the argument issue on alloglot likely within the next week or two. Let me see if I can get the multiple package case working on a toy project by wrapping the command in a simple script in the meantime |
That's appreciated, keep me posted! I'll leave this open for now, but I can open a linked issue in alloglot if that would be more helpful. Note that I'm not sure that being able to add arguments to alloglot would be sufficient, because I need to be able to add .hiefiles from each build directory, and I'm not sure if globs or multiple |
Great point - I'll add support for multiple hie file directories too |
Oh there is one other work-around too for the time being -
The following script can index all hiefiles in sub-directories into a single |
I had some time to continue tinkering, and after re-refreshing with a big build (and removing I'm missing documentation probably because the -hidir doesn't work for some reason, and sometimes when jumping to definition with ctrl+click my editor tries to open |
Hm I'll look into the hidir issue more - for the ctrl+click issue you may be able to modify the script a bit if you modify the first two commands:
you want to save the |
Maybe it's too early to tell, but deleting the top level .hiedb and rerunning everything seems to result in a more consistent "jump to" experience. I'll keep you posted. |
Still found one occurrence of a bad jump-to, odd that it was mostly fixed after a complete rebuild. |
Was this that it was jumping to the wrong (likely stale) location or that the jump to was not working? There are some recompilation issues i know of with ghc's recompilation checker not recompiling if whitespace was added for example which could cause the destination file to be stale. |
jumping to the wrong location, that of |
Tried to get hifiles working again, and read the error messages more closely.
looks like ghc/Cabal-library was struggling with the same thing that static-ls was, and it can't find the hifiles folders. |
Do you have any other flags (for example dynamic linking?). If you have the build directory you can directly symlink the hifiles instead and not use that flag:
This script should work for cabal (maybe stack too since it uses cabal beneath the hood - but in theory you could do something similar if it doesn't) |
I don't think we do much dynamic linking bar one package right near the end. the only flag that could be is -msse2.4, which I don't think is relevant. I'll adjust the script you've given above to work with multiple packages and report back after. |
I went with |
Hm i think we would need something similar to the other issue like a list of directories we could search for - unfortunately we dont have a running index of hifiles for now. |
I will lose access to this account soon, so feel free to close if and when you feel this is completed. |
Thanks for letting me know! |
As Mercury seem to have, I also have a large monorepo of a haskell project, which HLS cannot properly handle.
I'm currently struggling to get static-ls to work for my system.
I've attached the setup for static-ls to my pedantic build command, so I can explore it before offering it to the rest of my team; that looks as follows:
stack test --no-run-tests --work-dir .stack-work-pedantic --fast --haddock --ghc-options="-j4 -ddump-minimal-imports -Werror -fwrite-ide-info -hiedir .hiefiles -hidir .hifiles -fdefer-type-errors -Werror=deferred-type-errors -Werror=deferred-out-of-scope-variables -fno-defer-typed-holes -package-db /home/myname/.cabal/store/ghc-9.8.2-6af5/package.db -plugin-package hiedb-plugin -fplugin Plugin.HieDb" --bench --no-run-benchmarks "$@"
However, static-ls does not seem to be working. From what I can tell, the above command makes the .hiefiles folders go into the sub directories for each package, meaning that they cannot be access from the top level static-ls running.
I tried to use --hie-files, but I'm struggling to make this work with alloglot.
Would I be able to have some additional guidance on what to do?
Setup notes:
cabal install --lib
globally to avoid adding the depedency to the project for nowserverCommand
tostatic-ls --hie-files ./a-package/.hiefiles
to test it out, it understandably fails because that's not a single executable for it to start up.The text was updated successfully, but these errors were encountered: