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

Analyzer-plugin should allow extending refactoring #35578

Open
rrousselGit opened this issue Jan 6, 2019 · 0 comments
Open

Analyzer-plugin should allow extending refactoring #35578

rrousselGit opened this issue Jan 6, 2019 · 0 comments
Labels
analyzer-api Issues that impact the public API of the analyzer package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@rrousselGit
Copy link

A follow up to this conversation: https://groups.google.com/a/dartlang.org/forum/#!topic/analyzer-discuss/7mswT7KH1AU

The most important part of this discussion is:

As I'm sure you've figured out, when a client (like IntelliJ or VS Code) wants to make some functionality available to the user, it does so by using the client-server protocol defined by the Analysis Server API Specification to send a request to the server. If the server supports plugin participation in that request, it will then use the server-plugin protocol defined by the Analysis Server Plugin API Specification to send a request to the plugin.

Unfortunately, the plugin protocol does not currently support any APIs that would allow plugins to participate in refactoring requests.

I didn't realize that the plugin code still contained handler methods (handleEditGetAvailableRefactorings and handleEditGetRefactoring) related to refactorings. Those were added as part of an earlier exploration of what kind of refactoring support we might be able to add eventually, but they are not used. The requests they purport to handle don't exist, so server cannot send the requests, so those methods will never be invoked. They should have been removed. I'm sorry for the confusion their presence has caused.

I do hope that we can eventually return to the task of adding refactoring support for plugins, but until then I'm sorry to say that it just isn't possible.

A typical use-case is to extend the renaming refactor, so that multiple classes are edited simultaneously similarly to how a State from Flutter is renamed when StatefulWidget is refactored.

@vsmenon vsmenon added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Jan 7, 2019
@stereotype441 stereotype441 added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug analyzer-api Issues that impact the public API of the analyzer package labels Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-api Issues that impact the public API of the analyzer package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants