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

VSCode appends cmds.Completed whenever cmds.Builder is accessed #58

Closed
Delicious-Bacon opened this issue Jul 2, 2022 · 5 comments · Fixed by #368
Closed

VSCode appends cmds.Completed whenever cmds.Builder is accessed #58

Delicious-Bacon opened this issue Jul 2, 2022 · 5 comments · Fixed by #368

Comments

@Delicious-Bacon
Copy link

I'm using the latest VSCode

Whenever I use cmds.Builder and accept any of the suggested functions, VSCode appends cmds.Completed before the cmds.Builder.

It's best to explain it visually:
Code_Y06d4tSdJi

@rueian
Copy link
Collaborator

rueian commented Jul 2, 2022

Oh, it isn't very pleasant. Thank you for reporting this. I will see what I can do.

However, I believe this is a bug of the vscode golang extension, because the cmds.Completed is not exported and the extension just produces a code that wouldn't be compiled.

At this moment, I would recommend you use Goland instead of vscode.

@Delicious-Bacon
Copy link
Author

...the cmds.Completed is not exported and the extension just produces a code that wouldn't be compiled.

It is exported if it is uppercase, isn't it...? 🤔

@rueian
Copy link
Collaborator

rueian commented Jul 2, 2022

It is exported if it is uppercase, isn't it...? 🤔

No, it isn't. It lives in an internal package. Users are not allowed to import and use it directly.

If you try to import it, you will get a compile error like this:
image

@Delicious-Bacon
Copy link
Author

I see, thanks for the explanation!

And thank you for looking into it! ❤️

@rueian
Copy link
Collaborator

rueian commented Jul 3, 2022

Hi @Delicious-Bacon,

This issue is related to the official Go language server and may not have a solution in a short time.

Instead of using another IDE/Editor, you can just not access cmds.Builder in the client.Do. For example, preparing the command beforehand.

cmd := client.B().Get().Key("mykey").Build()
client.Do(ctx, cmd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants