semgrep / semgrep-vscode

Semgrep extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=semgrep.semgrep
GNU Lesser General Public License v2.1
53 stars 24 forks source link

feat(search): search 2.0 #123

Closed brandonspark closed 5 months ago

brandonspark commented 6 months ago

What:

This PR revamps Semgrep's IDE search to have a more accessible UI, as well as being more responsive and more expressive in some ways.

Why:

Semgrep's search is currently nice, but I wouldn't use it because of several UX troubles. Currently, you have to go through a bunch of buttons clicks, and search is pretty slow to boot.

How:

We deprecated the VS Code API based UI for one which is entirely in React, in the form of a webview. This lets us have full customizability over what the UI looks like.

We also made several engine improvements which are consumed by the new UI to offer better UX, such as:

Test plan:

Thorough manual testing.

image

PR checklist:

If you're unsure about any of this, please see:

brandonspark commented 6 months ago

(tagging @bkettle if you have any concerns)

brandonspark commented 5 months ago

@ajbt200128 let me know how you feel about the current state management. i tried to pull all the state to the top of the App via a new useStore which simply gives the entire store object, which is then modified via a useSetStore hook which causes rerendering of the tree

i know you had reservations and wanted to use useState, but i wanted to avoid the scenario where i have to pass down an entire setState function through the whole tree. with the useSetStore hook, any part of the tree can trigger a re-setting of the store, without needing to pass down the setter everywhere