json: Add runnable for package.json and composer.json scripts (#12285)

**Package.json**


https://github.com/zed-industries/zed/assets/62463826/f8ca12a5-1292-4465-83e1-3c2ab65f5833

**Composer.json**


https://github.com/zed-industries/zed/assets/62463826/61f9e74d-c6ed-4329-855b-d0161e0a117b

Release Notes:

- Added runnable for `package.json` and `composer.json` scripts
([#12215](https://github.com/zed-industries/zed/issues/12215)).
This commit is contained in:
Remco Smits 2024-05-26 13:47:49 +02:00 committed by GitHub
parent a1e5b122e7
commit 5665cad250
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,21 @@
; Add support `package.json` and `composer.json` script runnable
(
(document
(object
(pair
key: (string
(string_content) @_name
(#eq? @_name "scripts")
)
value: (object
(pair
key: (string (string_content) @run @script)
)
)
)
)
)
(#set! tag package-script)
(#set! tag composer-script)
)

View File

@ -0,0 +1,14 @@
[
{
"label": "package script $ZED_CUSTOM_script",
"command": "npm run",
"args": ["$ZED_CUSTOM_script"],
"tags": ["package-script"]
},
{
"label": "composer script $ZED_CUSTOM_script",
"command": "composer",
"args": ["$ZED_CUSTOM_script"],
"tags": ["composer-script"]
}
]