Skip to content

glob filter for implementation and reference #3702

Open
@7sunarni

Description

@7sunarni

Is your feature request related to a problem? Please describe.
Sometimes, when we want to find one function had been used in somewhere, we may found there are lots of reference in some test files or some mock files.

Usually, we may skip this references when we view the popup window.

And this is same like to do some search in the vscode global search bar, and there we can config files to include and/or files to exclude to filter out some files we don't care.

Image

I just think if the extension can do same filter in find references, it will save much time when the project is huge.

Describe the solution you'd like

I migrated the vscode glob implementation code so the extension can behave to the vscode search glob.
Then I added some filters in the reference and implementation function. And I shared my extension to my workmates, I think this actually make us easier to work in huge project(we need to check the Kubernetes code)

and this is my settings

{
...
    "go.implementation": {
        "filesExclude":"{**/fake/**,**/*_test.go,**/testing/**}",
    },
    "go.reference": {
        "filesExclude":"{**/fake/**,**/*_test.go,**/testing/**,**/test/**}",
    },
...
}

Describe alternatives you've considered
If the gopls have some options to do filter, it would may be better and easy.

Additional context
vscode glob implementation doesn't export to its extension library. This may dependent on that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions