go-langserver icon indicating copy to clipboard operation
go-langserver copied to clipboard

Remove RootImportPath

Open keegancsmith opened this issue 8 years ago • 3 comments

This is an extension we added that we don't really need. We use it, and it has caused features to not work in vscode. I think we can just get rid of it. On sourcegraph.com the value is basically set by this snippet of code

                // Put all files in the workspace under a /src/IMPORTPATH
                // directory, such as /src/github.com/foo/bar, so that Go can
                // build it in GOPATH=/.
                if isStdlib {
                        langInitParams.RootPath = "file://" + goroot
                } else {
                        langInitParams.RootPath = "file://" + "/src/" + h.rootImportPath
                }
                langInitParams.RootImportPath = h.rootImportPath

which means we can just rely on RootPath (except for special casing stdlib). Out of interest h.rootImportPath is empty for stdlib, and otherwise is detected based on the repo path / found package import doc strings.

https://sourcegraph.com/github.com/sourcegraph/go-langserver@7b4451f3b17c590d88cd39be546fc8772c3bddac/-/blob/langserver/lspx.go#L26:40

keegancsmith avatar Jan 24 '17 09:01 keegancsmith

@slimsag, @sqs agree?

keegancsmith avatar Jan 24 '17 09:01 keegancsmith

👍

sqs avatar Jan 24 '17 12:01 sqs

👍

emidoots avatar Jan 31 '17 19:01 emidoots