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

Allow to filter list by reference kind #64528

Closed
IllusionMH opened this issue Nov 15, 2018 · 9 comments
Closed

Allow to filter list by reference kind #64528

IllusionMH opened this issue Nov 15, 2018 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code references-viewlet

Comments

@IllusionMH
Copy link
Contributor

It would be great to have an ability to filter found references.
For example:
"Hide imports" that will hide references inside of import statements and direct require assignments.
At this moment each file usually contain 2+ references and first one if always inside of the import statement, but it is rarely place that devs are looking for.
"Hide definition" there is separate commands "Go to/Peek Definition" and when looking for references-usages won't introduce one more.

In combination with #15 (that recalculated according to filters) this will provide proper count of usages.

@jrieken jrieken transferred this issue from microsoft/vscode-references-view Dec 6, 2018
@vscodebot vscodebot bot assigned mjbvz Dec 6, 2018
@vscodebot vscodebot bot added the javascript JavaScript support issues label Dec 6, 2018
@jrieken jrieken assigned jrieken and unassigned mjbvz Dec 6, 2018
@jrieken jrieken added feature-request Request for new features or functionality references-viewlet and removed javascript JavaScript support issues labels Dec 6, 2018
@jrieken
Copy link
Member

jrieken commented May 28, 2019

/duplicate of #50062

@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label May 28, 2019
@vscodebot
Copy link

vscodebot bot commented May 28, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed May 28, 2019
@IllusionMH
Copy link
Contributor Author

IllusionMH commented May 28, 2019

@jrieken I'm not sure that this is duplicate of mentioned issue.
#50062 is about general search/filter while this one is about adding controls for specific filters for references.

In particular references inside of import statements (basically duplicates inside one file where it will be actually used) and definitions (actually #68071 is duplicate of "Hide definition" part of this issue)

UPD.
For example: WebStorm panel for Find Usages
image
Toggles outlined in read are: Show read access, Show write access, and Show import statements.
If I toggle "Show import statements" then all import statements with reference in question will be filtered out, and I will see only relevant usages.

@IllusionMH
Copy link
Contributor Author

@jrieken could you please reconsider and re-open this issue because it is not duplicate of #50062?

@jrieken jrieken reopened this May 29, 2019
@jrieken
Copy link
Member

jrieken commented May 29, 2019

Yes, this isn't a dupe but TBH this is far out of scope because the API doesn't define any semantics on references. Eg the editor doesn't know anything about references, they are just pointers to some line of source. The proposed API for call hierarchies (#70231) will have this knowledge and while the first UX is peek based, there will likely be a viewlet based UX too.

@jrieken jrieken added *out-of-scope Posted issue is not in scope of VS Code and removed *duplicate Issue identified as a duplicate of another issue(s) labels May 29, 2019
@vscodebot
Copy link

vscodebot bot commented May 29, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed May 29, 2019
@jrieken jrieken changed the title Allow to filter list Allow to filter list by reference kind May 29, 2019
@IllusionMH
Copy link
Contributor Author

Thank you for explanation.
Just to clarify - if #70231 won't help with expected workflow I need to submit Language Service API proposal to enable more info about reference kind first?

@jrieken
Copy link
Member

jrieken commented May 29, 2019

need to submit Language Service API proposal to enable

Yeah, that would be helpful. Something that enhances this API first:

vscode/src/vs/vscode.d.ts

Lines 2718 to 2731 in 4c5705f

export interface ReferenceProvider {
/**
* Provide a set of project-wide references for the given position and document.
*
* @param document The document in which the command was invoked.
* @param position The position at which the command was invoked.
* @param token A cancellation token.
*
* @return An array of locations or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined`, `null`, or an empty array.
*/
provideReferences(document: TextDocument, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;
}
. E.g instead of returning a Location[] allow to return something comparable to DocumentSymbol. Once we have it in VS Code, we follow up with LSP. It also needs a reasonable default, e.g. all Location-only references are of some default kind and then the UIs can follow...

This a long shot, but don't get me wrong. I do like this feature but it will take a while till we are there

@IllusionMH
Copy link
Contributor Author

@jrieken understood. Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code references-viewlet
Projects
None yet
Development

No branches or pull requests

3 participants