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

Remove Definitions from References #68071

Closed
esemlabel opened this issue Feb 7, 2019 · 5 comments
Closed

Remove Definitions from References #68071

esemlabel opened this issue Feb 7, 2019 · 5 comments
Assignees
Labels
editor-symbols definitions, declarations, references feature-request Request for new features or functionality references-viewlet

Comments

@esemlabel
Copy link

esemlabel commented Feb 7, 2019

From Intelephence #171:

Remove Definition from Reference list, since there are different.
Defined functions or methods should'n appear in reference list, because they'r not references and available from separate menu Go/Peek Definition or within shortcut.

@bmewburn
Version 1.0 will respect the value of ReferenceContext.includeDeclaration which is sent with the textDocument/references request. In my tests vscode sends true for this value when finding references so definitions/declarations will be included. Please file an issue against the vscode repo if you think this should be changed.

Similar to #18338, but required for PHP as well.

  • VSCode Version: 1.30.2
  • OS Version: OS X 10.11.6
@vscodebot
Copy link

vscodebot bot commented Feb 7, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot assigned mjbvz Feb 7, 2019
@vscodebot vscodebot bot added the javascript JavaScript support issues label Feb 7, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 7, 2019

I don't understand this ask. Can you please provide an example

@mjbvz mjbvz added info-needed Issue requires more information from poster api and removed javascript JavaScript support issues labels Feb 7, 2019
@esemlabel
Copy link
Author

esemlabel commented Feb 7, 2019

I don't understand this ask. Can you please provide an example

Here's an example of sample php code with function definition and 2 calls after.

2019-02-07 21 13 57

There are 4 actions on functions or methods we can perform to get definition or references from context or with shortcuts, which have to do the following, when placing cursor, for example, under the last test occurrence:

  1. Go to Definition.
    Place cursor under function test on line 4.

  2. Peek Definition.
    Show function definition on line 4 in popup window.

  3. Find All References.
    List 2 references on line 8 and 11 in Reference Search View in Sidebar.

  4. Peek References.
    List 2 references on line 8 and 11 in popup window.

But when you want to list all references in sidebar (3) or in popup (4), not only 8 and 11 line will appear in the list, but the line 4 with function definition as well. This is wrong because function definition is not a reference and it should'n appear in the references list.

2019-02-07 22 06 41

The similar problem with TS language were discussed in #18335 and fixed in #18338.
The same problem exists in PHP language right now, so we need fix it as well.

@bmewburn, who currently maintaining PHP Intelephense extension for vscode, which actually adds Go/Peek Definition functionality for PHP language, assure that the problem is in vscode itself (please, read his comment on top).

@mjbvz mjbvz assigned jrieken and unassigned mjbvz Feb 12, 2019
@mjbvz mjbvz removed the info-needed Issue requires more information from poster label Feb 12, 2019
@jrieken jrieken added feature-request Request for new features or functionality editor-symbols definitions, declarations, references and removed api labels Feb 12, 2019
@jrieken
Copy link
Member

jrieken commented Aug 29, 2019

closing as duple of #74237

@sean-mcmanus
Copy link
Contributor

I assume you marked this as a duplicate of #74237 under the intention that "definition" would be considered a "type"?

Specific language extensions themselves could filter out the Definitions if they wanted to and it wouldn't need to be handled by VS Code itself. With the C/C++ extension and in VS, we treat definitions and declarations as just another "confirmed reference" type with no property or filter for defintion, declaration, or usage -- we could add it though: I've filed a feature request at microsoft/vscode-cpptools#4245 .

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-symbols definitions, declarations, references feature-request Request for new features or functionality references-viewlet
Projects
None yet
Development

No branches or pull requests

4 participants