haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.71k stars 368 forks source link

Configuration for how much of the project to build #3873

Open michaelpj opened 11 months ago

michaelpj commented 11 months ago

At the moment, HLS builds only the files that are open in the editor by default (and their dependencies). We have the checkProject option, which instead builds all the files in the current component.

Especially once proper multi-component support is finished, it seems to me that there are actually several levels of aggressiveness that you might want.

  1. Build only the files open in the editor
  2. Build all the files in the current component
  3. Build all the files in all the components in the current package
  4. Build all the files in all the components in all the packages in the project

So I wonder if we should replace checkProject with a new option (buildAggressiveness?) with four alternatives:

  1. open-files
  2. current-component
  3. current-package
  4. all-packages
Anrock commented 11 months ago

Would it be possible to have sort of incremental option where HLS first build open-files then if everything is ok, builds current-component and so on until everything is built?

michaelpj commented 11 months ago

I'm unsure if that makes sense based on how HLS works :thinking:

soulomoon commented 9 months ago

Would it be possible to have sort of incremental option where HLS first build open-files then if everything is ok, builds current-component and so on until everything is built?

I think it already is, HLS keeps files of interest (which are open-files) in shake. And doing build related to FOI.

michaelpj commented 9 months ago

I think that's just describing the open-files strategy: FOIs more-or-less correspond to open files. We don't then go on to build the rest of the project or anything.

michaelpj commented 3 months ago

Just to add a few more thoughts: while in some ways "load everything in the project" is probably the most intuitive thing for users, I think we need it to be configurable because for people (often in industry) with very large projects this may just eat all their memory.