Update for future reference.

The issue seems to be caused by opening multiple projects that uses the 
same language server — in this case, Gopls. The language server’s workspace 
is defined only once by BBEdit when a project is opened. Each subsequent 
project inherits the same workspace, which might confuse certain servers.

For instance, if I open BBEdit, then open the Go project "/Developer/foo", 
the server’s workspace is correctly set to "/Developer/foo", and everything 
works fine. If I then open another Go project, say "/Developer/bar", 
without quitting BBEdit, the server still assumes the workspace is 
"/Developer/foo”.

The issue can be “solved” by closing all projects and reopening BBEdit.

Bare Bones is aware of this limitation, which might be addressed in future 
version.

On Thursday, December 14, 2023 at 12:24:51 PM UTC-5 Maxime Pigeon wrote:

> Hi,
>
> I’m having issues with Go’s language server in BBEdit. When I open a 
> simple Go project, that is, a repository with a single module (for instance 
> : https://github.com/eliben/static-server), I get an error saying “This 
> file is within module “Downloads/static-server” which is not included in 
> your workspace…”, and another error about not being able to find a package 
> in GOROOT or GOPATH.
>
> I get this error in the logs: 
>
> 2023-12-14 12:11:40.325: Server message: 2023/12/14 12:11:40 errors 
> loading workspace: You are outside of a module and outside of $GOPATH/src.
> If you are using modules, please open your editor to a directory in your 
> module.
> If you believe this warning is incorrect, please file an issue: 
> https://github.com/golang/go/issues/new.
> snapshot=3
> directory=file:///Users/maximepigeon/
>
> It’s as if BBEdit is not properly communicating my project directory, 
> which should be  “/Users/maximepigeon/Download/static-server” to gopls.
>
> I’m fairly certain this is not an error with the repository since it works 
> in other editors (VSCode, Sublime, Helix). It also doesn’t work if I move 
> the repository somewhere else.
>
> Best,
> Maxime
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/7cafc8ea-8d92-481b-924f-39b961d201adn%40googlegroups.com.

Reply via email to