Closed weelillad closed 5 years ago
The LSP works if I start Sublime Text from a terminal, instead of from the dock. This clued me in that maybe it's missing some env variables, that it would inherit from the terminal but not from the dock. After a bit of trial and error, I found that adding the following to the gopls
client config made the difference:
"env": {
"GOPATH": "/home/andy/ESTL/go",
"PATH": "/home/andy/ESTL/go/bin:/usr/local/go/bin"
}
Hope this will help anyone else who encounters similar issues.
Dug into this further and figured out that updates to env variables in Linux should be done in ~/.profile
for it to apply to desktop-launched applications. I'd put them in ~/.zshrc
, which meant that Sublime Text and its plugins couldn't see them unless I launch it from a zsh terminal. :sweat:
Eventually I added the GOPATH
and PATH
updates to my ~/.profile
, and I could use the config from #561 as it was. Took me 4 hours to get here; Googling for the symptoms provided no immediate answer. Hope this helps other poor souls who've made similar mistakes.
gopls
server seems to be initialized properly but it is not returning any information at all from within Sublime Text. Calling from the command line works, though:elementaryOS Juno (built on Ubuntu 18.04 LTS)
gopls (installed 3 May 2019)
Package Control
command
in above config elsegopls
cannot be found:"command": ["/home/andy/ESTL/go/bin/gopls"]
Meanwhile, status bar will flash this message briefly:
no file information for file:///home/andy/ESTL/tga-backend/main.go
, with the open file as a URL instead of a file path.