zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
41.68k stars 2.17k forks source link

View NPM scripts #12308

Open Angelk90 opened 1 month ago

Angelk90 commented 1 month ago

Check for existing issues

Describe the feature

https://github.com/zed-industries/zed/assets/20476002/5d06a74f-9ad3-46e8-b589-4f432abe5d23

Hi! @RemcoSmitsDev : Since you've already worked on something similar, you might want to take a look.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

RemcoSmitsDev commented 1 month ago

Can you explain more what you are missing inside Zed now and what problem the feature you are pointing out solves? If I look at the video, it seems that it's similar to this, but more in a file structure way.

Screenshot 2024-05-26 at 11 13 46
Angelk90 commented 1 month ago

@RemcoSmitsDev : To do what you say to execute a command I have to open search for the package.json file, open it, click to execute the command.

Instead, if it is automatically detected that there is a package.json file, give the possibility as vscode does to make a view appear, with possible commands that can be executed quickly.

Screenshot 2024-05-26 alle 14 07 58
versecafe commented 1 month ago

instead of a terminal UI for it could have the tasks panel search over all package.json, Cargo.toml, etc to find all valid "scripts" ignoring dirs that are in the .gitignore

Angelk90 commented 1 month ago

@versecafe : Is there a panel tasks?

versecafe commented 1 month ago
image

It also picks up default tasks for rust projects such as cargo run cargo test etc

RemcoSmitsDev commented 1 month ago

Yeah, like @versecafe is pointing out. Zed already has a modal where you can see all the tasks that you can run inside the current context. If you would like to run tasks that are not connected to a context (file, line, column, symbol etc.) then you need to make them yourself. That you could see all the tasks, instead only the ones that you can run in the current context.

So to come back to your feature request, I think the task: spawn modal already shows all the tasks you want to see in a quick way.

Angelk90 commented 1 month ago

@RemcoSmitsDev : I don't see anything at the moment.

Screenshot 2024-05-26 alle 22 01 02
RemcoSmitsDev commented 1 month ago

@Angelk90 Running scripts inside package.json and composer.json was just merged a couple of hours ago. This will probably be out Wednesday in the preview release.

And keep in mind that the package.json and composer.json tasks/runnable are only shown if you are in the right context. We could maybe show the tasks that do not depend on current SYMBOL, selected text, row, column always when you are in the current file Instead, only if you are in the runnable ranges, so it's more close to your initial screenshot.

Tasks like these are not connected to a specific part of your code, that is why you always see them if you are in a Rust file.

Screenshot 2024-05-26 at 22 24 45