chapel-lang / chapel-vscode

Apache License 2.0
3 stars 2 forks source link

User experience improvements #2

Closed jabraham17 closed 4 months ago

jabraham17 commented 4 months ago

This PR improves the user experience of this extension by more gracefully handling errors and introducing ways of recovering from those errors

In this PR

[Reviewed by @ShreyasKhandekar]

mppf commented 4 months ago

If Chapel is installed with a prefix installation, there is no need to set CHPL_HOME, but chpl would be in the path.

jabraham17 commented 4 months ago

If Chapel is installed with a prefix installation, there is no need to set CHPL_HOME, but chpl would be in the path.

Yes, this PR searches PATH for any chpl executable, and then checks if it can find CHPL_HOME from that (since chplcheck and chpl-language-server both require it). Its mostly a heuristic, as the vscode api does not let me execute code and get back the result (so no chpl --print-chpl-home). See https://github.com/chapel-lang/chapel-vscode/blob/7f5ddef57b461293cb62211f83b957ce203fc244/src/ChplPaths.ts#L68

mppf commented 4 months ago

Right, but a --prefix installed isn't laid out that way. For example, chpl might be in /usr/bin and neither /usr nor / are "CHPL_HOME". Of course, this does not need to be fixed right now, especially if chplcheck/chpl-language-server don't work in this mode. Just something to be aware of.