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

Feature request: option to prevent intellisense from showing members of members #3673

Open
rodrigocfd opened this issue Jan 30, 2025 · 2 comments

Comments

@rodrigocfd
Copy link

After typing . or when hitting Ctrl + Space, VSCode shows a list of members of the struct, including functions. This list, currently, also displays some members of members, and there is no way to disable this behavior:

Image

Please consider adding an option to disable this behavior.

@gopherbot gopherbot added this to the Untriaged milestone Jan 30, 2025
@findleyr
Copy link
Member

This actually happens to already exists, in the form of an internal (hidden) option: "deepCompletion": false.
Currently, that exists only for tests--we don't advertise it or expect our users to use it.

Can you say more about why you don't want this behavior? For example, if you were completing in the context where a uint type is expected, deep completion can find completions (address.number) that match the implied type constraint.

IIRC we limit the number of deep completions (I think to 3).

@rodrigocfd
Copy link
Author

Can you say more about why you don't want this behavior? For example, if you were completing in the context where a uint type is expected, deep completion can find completions (address.number) that match the implied type constraint.

I'm the author of Windigo, which is under heavy refactoring right now. That's where I noticed some odd stuff showing.

While in some cases the deep completion is indeed useful (like in the Address example), in some cases it shows misleading or nonsensical choices, like:

func foo() {
	v := ole.NewVariant.Empty()
	defer v.VariantClear()
}

This is what I'm seeing:

Image

Maybe in addition of true and false, we could have an option to deep complete just structs, not results from functions.

Even so, I believe disabling deep completion would lead to less visual pollution – and since it's a matter of preference, I believe it would do no harm. It would be opt-out anyway.

@ansaba ansaba modified the milestones: Untriaged, vscode-go/backlog Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants