Golang gopls: Difference between revisions

From wikinotes
No edit summary
Line 22: Line 22:
<blockquote>
<blockquote>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
gopls rename main.go:10:5 Foo  # rename word from 'main.go' line:10, col:5, to 'Foo'
gopls rename main.go:10:5 Foo  # rename identifier from 'main.go' line:10, col:5, to 'Foo'
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Rename -->
</blockquote><!-- Rename -->
</blockquote><!-- Usage -->
</blockquote><!-- Usage -->

Revision as of 17:48, 26 June 2022

Go LSP create/maintained by the go team.

Documentation

github https://github.com/golang/tools/tree/master/gopls

Install

go install golang.org/x/tools/gopls@latest

Usage

Rename

gopls rename main.go:10:5 Foo  # rename identifier from 'main.go' line:10, col:5, to 'Foo'