haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Configuration for how much of the project to build

Open michaelpj opened this issue 1 year ago • 5 comments

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

michaelpj avatar Nov 15 '23 14:11 michaelpj

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?

Anrock avatar Nov 16 '23 10:11 Anrock

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

michaelpj avatar Nov 17 '23 09:11 michaelpj

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.

soulomoon avatar Jan 16 '24 11:01 soulomoon

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 avatar Jan 16 '24 16:01 michaelpj

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.

michaelpj avatar Jul 16 '24 09:07 michaelpj