Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit bc3adb4

Browse files
authored
fix bad URI from xdependencies (#353)
1 parent d032df1 commit bc3adb4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

buildserver/build_server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"path"
1212
pathpkg "path"
1313
"path/filepath"
14+
"reflect"
1415
"runtime"
1516
"strings"
1617
"sync"
@@ -497,7 +498,9 @@ func (h *BuildHandler) rewriteURIFromLangServer(uri lsp.DocumentURI) (lsp.Docume
497498
h.HandlerShared.Mu.Unlock()
498499
var d *gosrc.Directory
499500
for _, dep := range deps {
500-
if strings.HasPrefix(p, dep.ProjectRoot) {
501+
pathComponents := strings.Split(p, "/")
502+
depComponents := strings.Split(dep.ProjectRoot, "/")
503+
if reflect.DeepEqual(pathComponents[:len(depComponents)], depComponents) {
501504
d = dep
502505
}
503506
}

0 commit comments

Comments
 (0)