Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: support all features on the command line #32875

Open
stamblerre opened this issue Jul 1, 2019 · 31 comments
Open

x/tools/gopls: support all features on the command line #32875

stamblerre opened this issue Jul 1, 2019 · 31 comments

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jul 1, 2019

gopls features like find references, rename, etc. should work on the command line. Support for them should be added to internal/lsp/cmd. Right now, only definition and format are supported.

@hartzell

This comment has been minimized.

Copy link

@hartzell hartzell commented Sep 6, 2019

If no one's working on it, I'll take a swing at adding rename. Looks like it's a matter of adding an internal/lsp/cmd/rename.go that defines a type rename struct {...} and fleshing out a Run method for it. Looks like the rename machinery wants to work from a position, seems like I can mimic/steal what the query definition subcommand uses. Anything I'm missing?

@hartzell

This comment has been minimized.

Copy link

@hartzell hartzell commented Sep 20, 2019

I'll take a swing at adding rename

This has been merged, see golang/tools#157. Great support for a first time contributor.

@rentziass

This comment has been minimized.

Copy link
Contributor

@rentziass rentziass commented Oct 16, 2019

If no one's on it, I'd give references a spin 😊

@stamblerre

This comment has been minimized.

Copy link
Contributor Author

@stamblerre stamblerre commented Oct 16, 2019

@rentziass: Absolutely, please do! Feel free to reach out with any questions here or on the Gophers Slack (https://invite.slack.golangbridge.org/).

@kalmanb

This comment has been minimized.

Copy link

@kalmanb kalmanb commented Oct 17, 2019

@stamblerre any others need implementation?

@stamblerre

This comment has been minimized.

Copy link
Contributor Author

@stamblerre stamblerre commented Oct 17, 2019

Anything that doesn't have a test in this file is available: https://github.com/golang/tools/blob/e4d7c6f25b8e08c4784d6585835a053ae0ad53bb/internal/lsp/cmd/test/cmdtest.go#L41. I would suggest Import or SuggestedFix as a useful next feature.

@kalmanb

This comment has been minimized.

Copy link

@kalmanb kalmanb commented Oct 18, 2019

Great, thanks I'll SuggestedFix a go.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 19, 2019

Change https://golang.org/cl/202178 mentions this issue: tools/gopls: add cmd support for references

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 21, 2019

Change https://golang.org/cl/202480 mentions this issue: tools/gopls: add command line support for suggestedfix

@kalmanb

This comment has been minimized.

Copy link

@kalmanb kalmanb commented Oct 22, 2019

I'll also take a look at Import and Link

kalmanb added a commit to kalmanb/tools that referenced this issue Oct 22, 2019
This adds support for calling import from the gopls command line,
e.g.

$ gopls imports -w ~/tmp/foo/main.go

Optional arguments are:
-w, which writes the changes back to the original file; and
-d, which prints a unified diff to stdout
With no arguments, the changed files are printed to stdout.

Updates golang/go#32875
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 22, 2019

Change https://golang.org/cl/202624 mentions this issue: tools/gopls: add command line support for imports

@rentziass

This comment has been minimized.

Copy link
Contributor

@rentziass rentziass commented Oct 23, 2019

I'll keep going with SignatureHelp and Symbol then :)

kalmanb added a commit to kalmanb/tools that referenced this issue Oct 24, 2019
e.g.

$ gopls links ~/tmp/foo/main.go

Optional arguments are:
-json, which emits range and uri in JSON
With no arguments, a unique list of links are emitted.

Updates golang/go#32875
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 24, 2019

Change https://golang.org/cl/203297 mentions this issue: tools/gopls: add command line support for imports

gopherbot pushed a commit to golang/tools that referenced this issue Oct 25, 2019
This change adds command line support for references.

Example:

$ gopls references ~/tmp/foo/main.go:8:6
$ gopls references ~/tmp/foo/main.go:#53

Updates golang/go#32875

Change-Id: I9a0cf6ae8ba0a5c3d4ffc829b96fe3b42297c192
Reviewed-on: https://go-review.googlesource.com/c/tools/+/202178
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 27, 2019

Change https://golang.org/cl/203609 mentions this issue: tools/gopls: add cmd support for symbols

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Oct 29, 2019

Change https://golang.org/cl/204057 mentions this issue: tools/gopls: add cmd support for signature

gopherbot pushed a commit to golang/tools that referenced this issue Nov 12, 2019
This change adds command line support for foldingRange.
Provided with a file, it will display a list of folding
ranges within that file, with 1-indexed positions using
the format
{startingLine}:{startingChar}-{endingLine}:{endingChar}

Example:

$ gopls folding_ranges ~/tmp/foo/main.go
$
$ 3:9-6:0
$ 10:22-11:32
$ 12:10-12:9
$ 12:20-30:0

Updates golang/go#32875

Change-Id: Ib35cf26088736e7c35612d783c80be7ae41b6a70
Reviewed-on: https://go-review.googlesource.com/c/tools/+/206158
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@rhnvrm

This comment has been minimized.

Copy link
Contributor

@rhnvrm rhnvrm commented Nov 17, 2019

Taking up prepare_rename

rhnvrm added a commit to rhnvrm/tools that referenced this issue Nov 17, 2019
rhnvrm added a commit to rhnvrm/tools that referenced this issue Nov 17, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 17, 2019

Change https://golang.org/cl/207579 mentions this issue: tools/gopls: add cmd support for prepare_rename

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 18, 2019

Change https://golang.org/cl/207291 mentions this issue: tools/gopls: add cmd support for highlight

@rentziass

This comment has been minimized.

Copy link
Contributor

@rentziass rentziass commented Nov 18, 2019

Moving on to Completion

rhnvrm added a commit to rhnvrm/tools that referenced this issue Nov 18, 2019
rhnvrm added a commit to rhnvrm/tools that referenced this issue Nov 19, 2019
@jbszczepaniak

This comment has been minimized.

Copy link

@jbszczepaniak jbszczepaniak commented Nov 20, 2019

I will jump into Implementation

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 21, 2019

Change https://golang.org/cl/208357 mentions this issue: tools/gopls: add cmd support for implementation

@jbszczepaniak

This comment has been minimized.

Copy link

@jbszczepaniak jbszczepaniak commented Nov 22, 2019

I will jump into Highlight

@stamblerre

This comment has been minimized.

Copy link
Contributor Author

@stamblerre stamblerre commented Nov 22, 2019

@jbszczepaniak: I believe that Highlight has already been handled by https://go-review.googlesource.com/c/tools/+/207291. I just haven't had a chance to review it yet.

@jbszczepaniak

This comment has been minimized.

Copy link

@jbszczepaniak jbszczepaniak commented Nov 22, 2019

O, I see, right. It seems that these are yet to be done:

  • Completion
  • CompletionSnippet
  • UnimportedCompletion
  • DeepCompletion
  • FuzzyCompletion
  • CaseSensitiveCompletion
  • RankCompletion

I will take from the list - Completion

@rentziass

This comment has been minimized.

Copy link
Contributor

@rentziass rentziass commented Nov 22, 2019

@jbszczepaniak I'm currently working on Completion, see a couple of comments above :)

@jbszczepaniak

This comment has been minimized.

Copy link

@jbszczepaniak jbszczepaniak commented Nov 22, 2019

🤦‍♂ ok. I believe this is a list (right?):

  • CompletionSnippet
  • UnimportedCompletion
  • DeepCompletion
  • FuzzyCompletion
  • CaseSensitiveCompletion
  • RankCompletion

Thus I will take CompletionSnippet

@stamblerre

This comment has been minimized.

Copy link
Contributor Author

@stamblerre stamblerre commented Nov 22, 2019

@rentziass: Do you intend to add all of the completion related test code in your CL? In that case, I believe that this issue could be considered done.

@rentziass

This comment has been minimized.

Copy link
Contributor

@rentziass rentziass commented Nov 22, 2019

I'd surely like to try :)

@jbszczepaniak

This comment has been minimized.

Copy link

@jbszczepaniak jbszczepaniak commented Nov 22, 2019

rhnvrm added a commit to rhnvrm/tools that referenced this issue Nov 25, 2019
gopherbot pushed a commit to golang/tools that referenced this issue Nov 25, 2019
This change adds command line support for implementation.

Example:

$ gopls implementation ~/tmp/foo/main.go:8:6
$ gopls implementation ~/tmp/foo/main.go:#53

Updates golang/go#32875

Change-Id: I3aa89a788ded886368b07c1824325069f3cba88a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208357
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Nov 26, 2019
This change adds command line support for highlight.
Provided with an identifier position, it will display
the list of highlights for that within the same file.

Example:

$ gopls highlight ~/tmp/foo/main.go:3:9
$
$ 3:9-6:0
$ 10:22-11:32
$ 12:10-12:9
$ 12:20-30:0

Updates golang/go#32875

Change-Id: I5de73d9fbd9bcc59a3f62e7e9a1331bc3866bc75
Reviewed-on: https://go-review.googlesource.com/c/tools/+/207291
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@stamblerre stamblerre modified the milestones: Unreleased, gopls v1.0 Dec 4, 2019
rhnvrm added a commit to rhnvrm/tools that referenced this issue Jan 23, 2020
rhnvrm added a commit to rhnvrm/tools that referenced this issue Jan 24, 2020
rhnvrm added a commit to rhnvrm/tools that referenced this issue Jan 31, 2020
rhnvrm added a commit to rhnvrm/tools that referenced this issue Feb 4, 2020
gopherbot pushed a commit to golang/tools that referenced this issue Feb 4, 2020
This change adds command line support for prepare_rename.

Updates golang/go#32875

Change-Id: I7f155b9c8329c0faa26a320abab162730a7916ad
GitHub-Last-Rev: 118e846
GitHub-Pull-Request: #188
Reviewed-on: https://go-review.googlesource.com/c/tools/+/207579
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.