golps/protocol: introduce DocumentURI.Path method
This differs from the FilePath method because it returns a cleaned
/-separated path.
This is then used to make manipulation of paths safe within the LSP.
In https://cue.gerrithub.io/c/cue-lang/cue/+/1230705 we found and
corrected the use of a DocumentURI that was being directly cast to a
string. This meant that the URI encoding was not being removed.
However it turns out there are a couple of other locations in the LSP
where casting of URIs to strings were unsafe, and we want paths, not
filepaths. This new DocumentURI.Path method provides this functionality.
Signed-off-by: Matthew Sackman <matthew@cue.works>
Change-Id: Ic97ec0e337f9555888ea551805fe3996a6a6a27d
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1231004
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>