nwolverson / purescript-language-server

MIT License
184 stars 42 forks source link

Error in build command parsing #64

Closed natefaubion closed 4 years ago

natefaubion commented 4 years ago

The build command splits arguments by space: https://github.com/nwolverson/purescript-language-server/blob/1ae432e86573d51dc384e4f38c4e7b1d7caff337/src/LanguageServer/IdePurescript/Build.purs#L101

But this is problematic with spagos --purs-args flag:

spago build --purs-args="--stash --censor-lib --json-errors"

Since it will chunk these arguments as

[ "build", "--purs-args=\"--stash", "--censor-lib", "--json-errors\"" ]
natefaubion commented 4 years ago

The workaround is to use a separate--purs-arg flag for each one:

spago build --purs-args="--stash" --purs-args="--censor-lib" --purs-args="--json-errors"
nwolverson commented 4 years ago

Knew this was going to come back to bite eventually,,,

andys8 commented 4 years ago

Would avoid splitting quoted values ("") be a good enough solution to improve this?

nwolverson commented 4 years ago

Yes, I'm sure we can split better, not sure if split is easy to use or better to just match words including quoted phrases that may include spaces (easy enough to write/find a regex for that one)