ast-grep / ast-grep-vscode

ast-grep VSCode is a structural search and replace extension for many languages.

Home Page:https://marketplace.visualstudio.com/items?itemName=ast-grep.ast-grep-vscode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature] tracking for ast-grep-search-panel minimum viable product

SoonIter opened this issue · comments

commented

Context

See #31. Currently, ast-grep only has a CLI operation panel, and some users from the community would like to have a visual expression. If we provide a VSCode search panel in plugin, we will be better able to cover the usage scenarios in the developer's daily work.

There are two ways to achieve this, one is to integrate into the official VSCode search menu, but according to the microsoft/vscode#59921, there is currently no stable API in VSCode and the progress is very slow.

The other is to implement our own webview and UI. In my experiments in #48 , this method is more flexible but requires more work.
Currently, we have to choose the second option. If VSCode provides APIs that meet our needs in the future, we can also reuse some of the code and migrate it. (IMO, it will take at least two years)

Tracking

To achieve all our features in #31, there is currently a huge amount of work to be done and we can't finish it all at once.
This issue is mainly to achieve all the prerequisite tasks and provide a minimum implementation, on which we can iterate our core features.

Here is the task list I think need to be completed. If there are no major problems, I will create corresponding issues for each task and we can have deeper discussions in specific issues.

Step 1 Necessary infrastructure

In UI development, it is unbearable to work without hot module replacement.

Tasks

Step 2 UI

I referred to VSCode source code to draw a simple prototype sketch. It is simple and practical, containing three main parts SearchWidgetsContainer TextSearchProviderMessages and SearchResultList

If there are other better designs from other tools such as Codeque, please feel free to point them out.

image

Tasks