vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

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

Open rodrigocfd opened this issue 10 months ago • 2 comments

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.

rodrigocfd avatar Jan 30 '25 17:01 rodrigocfd

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).

findleyr avatar Jan 30 '25 18:01 findleyr

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.

rodrigocfd avatar Jan 30 '25 18:01 rodrigocfd