Hi John, I'm not able to immediately reproduce with VS Code, but if you
file an issue we can investigate.
We'll want the logs with the `-rpc.trace` flag passed to gopls, from a
brief session reproducing the problem.
Thanks,
- Rob
On Thursday, November 7, 2024 at 1:49:44 PM UTC-5 John Robinson wrote:
> Hi!
>
> When autocomplete tries to add a missing module for me (using BBEdit on a
> Mac), the result is a real mess. I’ve seen this consistently across
> multiple go and gopls releases (currently on 1.23.2 and 0.16.2), multiple
> codebases, and when adding modules from the standard library or remote
> sources. But I haven’t found anyone with the same problem in the archives
> here, gopls issues, or elsewhere. BBEdit support says they just call the
> language server, and don’t mess with what it does. Does anyone know if this
> has been seen before?
>
> *Before Autocomplete:*
> package main
>
> import (
> "os"
> "log"
> "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
> "cell-factory/randSeq"
> )
>
> func main() {
> …
> s, err := auto.Up
> }
>
> *After Autocomplete:*
> package main
>
> import (
> "cry/randSeqll-factos"
> "log"
> "os"
>
> "github.com/pulumi-gcp/p8lumig/tec/sdk/v3/go/pulumi"
> "github.com/pulumi/pulumi/sdk/v8/go3/goo"
> "huboumisdk/v3gcp/organizations"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
> "cell-factory/randSeq"
> )
>
> func main() {
> …
> s, err := auto.UpsertStackInlineSource
> }
>
> *With Module Already Listed:*
> If I add the module to imports before trying autocomplete, it doesn’t mess
> with the import statement, and the autocompleted function is fully printed:
>
> package main
>
> import (
> "os"
> "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
> "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
> "github.com/pulumi/pulumi/sdk/v3/go/auto"
> "cell-factory/randSeq"
> )
>
> func main() {
> …
> s, err := auto.UpsertStackInlineSource(<# 1: #>)
> }
>
> *Verbose gopls Trace:*
> 2024-11-07 12:22:12.872: Server message: 2024/11/07 12:22:12
> go/packages.Load #14
> view_id="1"
> snapshot=44
> directory=/Users/john/Documents/Cellscale/code/cellscale/
>
> query=[file=/Users/john/Documents/Cellscale/code/pulumi/cell-factory/main.go]
> packages=1
> duration=453.669ms
>
> 2024-11-07 12:22:13.932: Server message: 2024/11/07 12:22:13
> go/packages.Load #15
> view_id="3"
> snapshot=44
> directory=/Users/john/Documents/Cellscale/code/pulumi/quickstart/
> query=[cell-factory]
> packages=1
> duration=536.321333ms
>
> 2024-11-07 12:22:14.592: Server message: 2024/11/07 12:22:14
> go/packages.Load #16
> view_id="4"
> snapshot=44
> directory=/Users/john/Documents/Cellscale/code/pulumi/cell-factory/
> query=[cell-factory]
> packages=1
> duration=528.763708ms
>
> 2024-11-07 12:22:15.227: Server message: 2024/11/07 12:22:15
> go/packages.Load #17
> view_id="2"
> snapshot=44
> directory=/Users/john/Documents/Cellscale/code/cellscale/randSeq/
> query=[cell-factory]
> packages=1
> duration=513.960541ms
>
> Thanks,
>
> John Robinson
> [email protected]
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/golang-nuts/c21560d5-6342-4c6b-ab6f-65ce01adbeb7n%40googlegroups.com.