dev-resources.site
for different kinds of informations.
Go LSP in Sublime Text
Published at
1/1/2021
Categories
go
sublimetext
lsp
editor
Author
vuong
Main Article
Author
5 person written this
vuong
open
Here is how to configure LSP (language server protocol) for Go development in Sublime Text.
Prerequisites
- go
- gopls
- gotools (gofmt, goimports...)
Packages
- sublimelsp/LSP
LSP settings
Open LSP Settings, then paste the below one
// for MacOS
{
"clients":
{
"gopls":
{
"command": [
"<path_to>/go/bin/gopls",
"-v",
"-rpc.trace",
"-logfile=<path_to>/gopls.log"
],
"enabled": true,
"env": {
"PATH": "<echo $PATH in terminal then paste its value here>"
},
"scopes":["source.go"],
"syntaxes": ["Packages/Go/Go.sublime-syntax"],
"settings": {
"gopls.usePlaceholders": true,
"gopls.completeUnimported": true,
},
"languageId": "go"
}
}
}
// for Windows
{
"clients":
{
"gopls":
{
"command": [
"<path_to>\\bin\\gopls.EXE",
"-v",
"-rpc.trace",
"-logfile=<path_to>\\gopls.log"
],
"enabled": true,
"scopes":["source.go"],
"syntaxes": ["Packages/Go/Go.sublime-syntax"],
"settings": {
"gopls.usePlaceholders": true,
"gopls.completeUnimported": true,
},
"languageId": "go"
},
}
}
LSP Key Binding
Search LSP Key Binding then paste the below value into the field
[
// Go To Definition
{
"command": "lsp_symbol_definition",
"args": {
"side_by_side": false
},
"keys": [
"ctrl+d"
],
"context": [
{
"key": "lsp.session_with_capability",
"operator": "equal",
"operand": "definitionProvider"
},
{
"key": "auto_complete_visible",
"operator": "equal",
"operand": false
}
]
},
]
Known Issues
- Auto-format on macOS doesn't work but works well on Windows
=====
Updated: This package is now working well with simple set up. https://packagecontrol.io/packages/LSP-gopls
Gofumpt for auto-format also works: https://github.com/mvdan/gofumpt#sublime-text
lsp Article's
30 articles in total
How to Setup Vim for Kotlin Development
read article
Managing LSPs in Neovim: Enable/Disable for the Entire Session
read article
Integrating the ruff language server
read article
Series Belajar Solid Principle - Liskov Substitution Principle (LSP)
read article
Avoid conflicts between denols and tsserver in Neovim
read article
Avoid conflicts between denols and tsserver in Neovim
read article
Implementing Payment Gateways with the Liskov Substitution Principle
read article
SOLID Principles: Liskov Substitution Principle (LSP)
read article
Configure Helix to use ElixirLS
read article
The Power of Liskov Substitution Principle in Improving Software Design
read article
Neovim config from scratch (Part II)
read article
Neovim config from scratch (Part I)
read article
Integrating a Language Server (LSP) in a VS Code Extension
read article
My Neovim setup for React, TypeScript, Tailwind CSS, etc
read article
How i setup neovim for speed up React, Js, Ts, etc
read article
Solve nvim lsp denols vs tsserver clash
read article
Perl Navigator - Language Server for Perl
read article
Neovim LSP Setup + Code Completion Engine
read article
NeoVim: init.lua, built in LSP e mais
read article
How to fix [deno-ts 2339] in the code for Deno Deploy
read article
SOLID e o princÃpio do 6 por meia dúzia
read article
Java LSP in Sublime Text
read article
Neovim: Migrando do coc.vim para nvim-lsp
read article
Integrating Scala Metals with Doom Emacs using LSP on Pop!_OS/Ubuntu 20.04 LTS
read article
Builtin Solidity Language Server
read article
Liskov Substitution Principle
read article
Emacs as SQL client with LSP
read article
Vim Configuration from Minimal to Complete
read article
LSP and ISP: The LI of SOLID
read article
Go LSP in Sublime Text
currently reading
Featured ones: