mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-19 02:17:35 +03:00
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:
parent
a1e5b122e7
commit
5665cad250
21
crates/languages/src/json/runnables.scm
Normal file
21
crates/languages/src/json/runnables.scm
Normal 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)
|
||||
)
|
14
crates/languages/src/json/tasks.json
Normal file
14
crates/languages/src/json/tasks.json
Normal 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"]
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user