nwolverson / purescript-language-server

MIT License
184 stars 41 forks source link

Skip lib sources when rebuilding opened files #140

Closed wclr closed 3 years ago

wclr commented 3 years ago

Files that are opened in the editor automatically rebuilt (to show diagnostics without the need to update and save it), but it is not so actual for the library sources, esp considering that compiler currently rebuilds if they are not changed (and rebuild is actually not needed to be rebuilt, that may unnecessarily trigger file watching tools). So this checks if the file path contains .spago or bower_components to skip it.

nwolverson commented 3 years ago

To be clear, this is just skipping triggering a rebuild on dependency files on open, it will still be triggered if one edits and saves the file? That seems like a good compromise, of course people may occasionally make quick edits to dependencies inside .spago for example and that should still show diagnostics.

wclr commented 3 years ago

To be clear, this is just skipping triggering a rebuild on dependency files on open, it will still be triggered if one edits and saves the file? That seems like a good compromise, of course people may occasionally make quick edits to dependencies inside .spago for example and that should still show diagnostics.

Absolutely, this branch only affects opened (activated) files, the next handler onDidSaveDocument responsible for pushing diagnostics when the file is changed and saved.