-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
"Go to Implementation" across projects with an Analyzer? #8144
Comments
As mentioned in #7766, since analyzers are a compiler concept finding implementations across projects is not feasible in an analyzer. I think @jmarolf's suggestion was about providing such an API at the workspace layer so that if we have analyzers that can work at the workspaces level (#3797) then such an API could be used. |
We do NOT currently have this API to make public at the workspace layer. In our design discussions, the way we would approach implementing something like this is by reversing it and having your analyzer look at all method invocations, instead of looking at method declarations. |
Thanks for the feedback! Are there any plans to expose an API like that, possibly with some notion of VS-Analyzer? It seems counter-intuitive that something that is very easy to do interactively with VS, is very hard to do with an Analyzer. @Pilchie , can you please elaborate some more about the 'reverse' approach. I don't quite understand yet what you mean exactly. How would that apply to my 'go to type implementation' example? |
I'm fine with the notion of adding a Workspaces-layer data API for Go To Implementation (cc @jasonmalinowski about that). However, I'm loathe to introduce the concept of workspace analyzers that know about multiple projects, since I think a big part of the value of analyzers is their ability to travel with compilation to CI servers, etc. From you description above here though, it doesn't really sound like you're looking for Go To Implementation as we think about it. Instead you just want |
Thanks for the additional explanation, @Pilchie . Your're right with that's the kind of thing I'm looking for. I thought too that your approach described is what I have to resort to. I was hoping that the result of #6324 would help me with the file access. The advantage of that approach is hopefully that it's performant. I also agree that being able to run analyzers from the command line, for example on a CI server, is a big advantage of Analyzers. Optimally you could keep that, but still allow some solution level analysis, but I guess that's wishful thinking ;-) |
From within an Analyzer, is there a way to do a "go to implementation" (as in Visual Studio) across projects of the same solution? For example, I have a type symbol, and I want to go to the source code of that type, in order to analyze it. If that worked across projects, many solution-wide analyses would be simple to do.
Performance might be an issue, but how much that is an issue will likely vary from use-case to use-case.
The text was updated successfully, but these errors were encountered: