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

Find all references (Experimental Version) #15

Closed
csholmq opened this issue Apr 17, 2016 · 96 comments
Closed

Find all references (Experimental Version) #15

csholmq opened this issue Apr 17, 2016 · 96 comments
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@csholmq
Copy link
Contributor

csholmq commented Apr 17, 2016

Would be great to have Find all references working. Huge helper in large projects.

@eddy-geek
Copy link

Continuing #404 discussion, couldn't something be achieved with cscope (which seems to be the ctags equivalent for references /call hierarchy)?

I like the current lightweight ctags-based approach, as real "intellisense" is often hard to make work on projects using custom build systems, less error-resilient, and slower especially on network filesystems.

@sean-mcmanus
Copy link
Contributor

We don't use cscope or ctags and are not planning to. We expect the IntelliSense implementation to work.

@nevion
Copy link

nevion commented Jul 12, 2017

I was also surprised this feature was not available while trying VSCode again starting today, for the 3rd time in the last 3 years... Given this issue has been opened for over a year, is there a great deal of effort getting it done or is it motivation or priority related? Features like this shouldn't be kicked down the line and I believe the Go project for VSCode has the feature working. Given the length of time this has been opened I just want to make sure this is on developer's minds to get done, with that daily nagging feeling from knowing it's been on the todo list too long.

30 people have thumbs up'd, clearly this issue is important to users.

@sean-mcmanus
Copy link
Contributor

@nevion We have recently started doing work that is expected to enable the Find All References feature, along with other VS 2017 C++ features that are not currently available, such as comments in hover and parameter help. We don't have an ETA.

@agauniyal
Copy link

@sean-mcmanus 'comments in hover' refer to documentation about certain methods present inside comments or something else? If it's the former, will it be tied to certain style like doxygen or standardese?

@sean-mcmanus
Copy link
Contributor

@agauniyal It refers to showing the comments next to the definition/declaration of code, similar to what VS 2017 (you can try that to see how we expect it to behave). The internal style of the comments won't matter and we'd just show it as a comment.

@BryanDiLaura
Copy link

Really looking forward to this feature. Is there any sort of ETA?

@sean-mcmanus
Copy link
Contributor

@BryanDiLaura There is no ETA for Find All References. Finding references that occur in different translation units requires additional infrastructure/porting work. Once we have an ETA, we'll post it in a milestone: https://github.com/Microsoft/vscode-cpptools/milestones .

@techwoes
Copy link

techwoes commented Mar 7, 2018

While it's not as awesome as intellisense based symbols/tags, vscode-ag (silver searcher) is pretty fast to do searches. Although I wish it was more configurable, such as only searching cpp/c/h files like the command line version. Currently it searches everything in the folder. It might be an acceptable work around until the intellisense feature is available.

@Yanpas
Copy link

Yanpas commented Mar 9, 2018

BTW there is very powerful C++ extension cquery (https://marketplace.visualstudio.com/items?itemName=cquery-project.cquery)

It is blazingly fast, has all IDE features, including this one. I guess it's more reasonable to make this extension an official C++ one
aa

@agauniyal
Copy link

What do you mean by official?

@Yanpas
Copy link

Yanpas commented Mar 9, 2018

Default suggested one with green star label

@aenima1891
Copy link

I'm very interested in this feature.
It would be very useful

@xgalaxy
Copy link

xgalaxy commented Mar 29, 2018

RE: cquery

It would be nice if "C_Cpp.intelliSenseEngine" supported "None" or "Disabled". Right now I can't run both VSCode-cpptools and cquery extensions without a lot of performance degradation as both try to do intelligent indexing of the symbols. However, VSCode-cpptools provides useful features beyond just the intellisense such as debugging, so it would be nice if we could disable the intellisense engine.

@sean-mcmanus
Copy link
Contributor

@xgalaxy Setting the intelliSenseEngine to "Tag Parser" and the browse.path to [] should eliminate most indexing of symbols. Is there a reason that is not sufficient? That would only be a per-project fix, but when we expose a global setting for this, then you could set the global setting to be blank as well. We also have issue #785 tracking this.

@decimad
Copy link

decimad commented Mar 31, 2018

Yes, I switched to cquery too for its find all references, renaming etc. However even with Tag-Parser only you will get duplicate hover-tooltips for all local types. Also I did not find a way to suppress the warning squiggles that the parser could not find the header files.

@sean-mcmanus
Copy link
Contributor

@decimad Yeah, the include path warning isn't currently disable-able, which would be fixed by #785 . Duplicate items with tag parser is "by design" -- if cquery has hover support, you can clear the browse.path to reduce the amount of symbols, although we still parse symbols on open file, so there might be some symbols found anyway.

Our typescript is open source, so I believe it would be relatively easy to add a disable setting -- there's a comment in #785 that suggests one way to disable the extension via modifying the javascript.

@Timmmm
Copy link

Timmmm commented Jul 5, 2019

Until this is ready, I have things working pretty well with the vscode-clangd extension and this extension both enabled. Here are the key things you need to add to your settings:

    "C_Cpp.autocomplete": "Disabled",  // So you don't get autocomplete from both extensions.
    "C_Cpp.errorSquiggles": "Disabled", // So you don't get error squiggles from both extensions (clangd's seem to be more reliable anyway).
    "clangd.path": "/usr/local/opt/llvm/bin/clangd", // Path to clangd. Note it might be clangd-8 on Linux. Also you need version 8 at least.
    "clangd.arguments": [
        "-background-index" // So Find All References actually works properly.
    ],
    // Don't disable the intellisense engine otherwise switch header/source (Alt-O) doesn't work.

Also I then symlink compile_commands.json from my source directory to the build directory.

It is a little flaky. Sometimes clangd seems to get stuck and I have to reload the window. Also while error squiggles, Find All Reference, and Go To Definition work pretty reliably, Find Symbol doesn't. Still I think it is the best option until this extension supports it properly.

@cstrahan
Copy link

To add to what @Timmmm said, note that --background-index was introduced in clangd-8. I found out the hard way that clangd-7 doesn't expect that argument, and the completion server will crash inside of vscode with no indication of why (I had to write a wrapper script that redirected stderr/stdout to a file to inspect later in order to find out what was going on).

@HunterZ
Copy link

HunterZ commented Jul 16, 2019

We're getting closer to having a preview available for this feature. However, it doesn't look like it will be ready in time for our current release. We plan to have it ready for Insiders in the first half of July. Thank you for your patience and understanding.

Is this implementation going to work without requiring installation of external tools? It's hard for me to get tools, and Eclipse CDT provides this feature without them.

@dschaefer
Copy link

Is this implementation going to work without requiring installation of external tools? It's hard for me to get tools, and Eclipse CDT provides this feature without them.

:). Yes, indexing has been a core feature of CDT since the beginning. It's hard to do right enough and fast enough so I appreciate the time cpptools is taking to get there.

@sean-mcmanus
Copy link
Contributor

@HunterZ No external tools will be required.

@legal-username
Copy link

legal-username commented Jul 31, 2019

is it usable or not now?

@sean-mcmanus
Copy link
Contributor

@pig-peppa We're currently doing functionality and performance testing -- we might be able to release an Insider vsix next week or so.

@tooyangtoonaive
Copy link

up

@Timmmm
Copy link

Timmmm commented Aug 8, 2019

For those following this eagerly like me, this is the pull request: #4016.

It is only the VSCode configuration part of the change though. I think the meat of the work is in the closed-source intellisense engine, so I don't think we can try it out yet. Getting closer though!

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 8, 2019
@sean-mcmanus sean-mcmanus removed their assignment Aug 8, 2019
@MichaelDu9226
Copy link

fixed?when will be released?Can't wait for it!Thanks~

@starship863
Copy link

fixed?when will be released?Can't wait for it!Thanks~

Great! Let's celebrate!

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Aug 9, 2019

Find All References (and Peek References) is available via setting C_Cpp.updateChannel to "Insiders" (or manually install it from https://github.com/microsoft/vscode-cpptools/releases/tag/0.25.0-insiders ), and then setting the C_Cpp.experimentalFeatures setting to "Enabled" -- we hid the feature behind this setting so that we could get feedback on the feature from a smaller audience.

A bunch of "known issues" with the feature can be found at Feature: Find All References Find All References, Peek References, Rename . Please upvote the existing issues or file new issues if you encounter them. We would prefer you not to add the bugs to this issue, because it makes it harder to track.

@yamcenutzer
Copy link

nice..
However, it doesn't seem to install on remote (ssh) sessions

@bobbrow
Copy link
Member

bobbrow commented Aug 9, 2019

We're tracking #3833 and #3874 for the issues with Insiders in Remote workspaces.

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Aug 22, 2019

We shipped Find All References (Experimental Version) with 0.25.0. A list of known enhancements/bugs can be found at Feature: Find All References Find All References, Peek References, Rename . Our current plan for 0.26.0 is to add rename and to move the Output window non-confirmed results to the References tree view #4079. The main feedback we've gotten is for improving the performance.

UPDATE: I renamed the issue with "Experimental Version" to try to prevent people from thinking we're 100% done with the feature (since this issue is "closed"), aka "Version 1".

@Konstantin6487
Copy link

Konstantin6487 commented Aug 23, 2019

Still not working. VScode finds for example
import { loader } but doesn't find import { loader as basicLoader }
I created jsconfig, installed 0.25.0-insiders and nothing :(
It works in small project, but not in large.

@LeThiHyVong
Copy link

@Konstantin6487 what are you looking for?
This repo is C/C++ support extension of VSCode, not for other languages.

@Konstantin6487
Copy link

I'm sorry. I made a mistake. My problem is only with js.

@sean-mcmanus sean-mcmanus changed the title Find all references Find all references (Experimental Version) Aug 23, 2019
@XobSod
Copy link

XobSod commented Aug 28, 2019

Hi all,

You guys did something to C_Cpp.PeekDeclaration command? After updating the extension error appears:
command 'C_Cpp.PeekDeclaration' not found

@sean-mcmanus
Copy link
Contributor

@XobSod Yeah, it's removed -- we use the built-in Peek Declaration command now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests