Skip to content

Commit

Permalink
json: Add runnable for package.json and composer.json scripts (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
RemcoSmitsDev committed May 26, 2024
1 parent a1e5b12 commit 5665cad
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/languages/src/json/runnables.scm
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions crates/languages/src/json/tasks.json
Original file line number Diff line number Diff line change
@@ -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"]
}
]

0 comments on commit 5665cad

Please sign in to comment.