Skip to content

Commit f986cc0

Browse files
authored
👷 one-click dev setup for vscode (#241)
- Improve `make package` & `update-vsce` - `package` needs to `install` first. - Changed `npm install @vscode/vsce` to `update` as it otherwise changes the ordering in `package.json`
1 parent 812c335 commit f986cc0

7 files changed

+95
-9
lines changed

.vscode/launch.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch Extension",
9+
"type": "extensionHost",
10+
"request": "launch",
11+
"args": [
12+
// development in clean environment - source: https://github.com/microsoft/vscode/issues/159572#issuecomment-1240523504
13+
"--profile=extension-dev", // optional, but recommended - will launch extension in a clean instance
14+
// "--profile-temp", // alternative - will launch extension in a clean instance everytime
15+
"--extensionDevelopmentPath=${workspaceFolder}",
16+
],
17+
"outFiles": [
18+
"${workspaceFolder}/out/**/*.js"
19+
],
20+
"preLaunchTask": "npm: watch",
21+
}
22+
]
23+
}

.vscode/tasks.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "install",
7+
"group": "build",
8+
"isBackground": true,
9+
"problemMatcher": [],
10+
"presentation": {
11+
"reveal": "silent"
12+
},
13+
"label": "npm: install",
14+
"detail": "install dependencies from package"
15+
},
16+
/* from: https://github.com/microsoft/vscode-extension-samples/blob/main/helloworld-sample/.vscode/tasks.json */
17+
{
18+
"type": "npm",
19+
"script": "watch",
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"dependsOn": [
25+
"npm: install"
26+
],
27+
"isBackground": true,
28+
"problemMatcher": {
29+
"owner": "custom",
30+
"pattern": {
31+
"regexp": "IMJUSTHEREBECAUSETHERENEEDSTOBEADEFAULT - https://github.com/microsoft/vscode/issues/6209#issuecomment-1378126445"
32+
},
33+
"background": {
34+
"activeOnStart": true,
35+
"beginsPattern": "rollup v", // e.g. 'rollup v3.18.0'
36+
"endsPattern": "waiting for changes..."
37+
},
38+
},
39+
"presentation": {
40+
"reveal": "silent"
41+
},
42+
"label": "npm: watch",
43+
"detail": "compile & watch"
44+
}
45+
]
46+
}

CONTRIBUTING.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Contributing
2+
3+
This plugin is far from feature-complete.
4+
If you want to improve it, feel free to pick one of the [open issues](https://github.com/mre/vscode-snippet/issues) and give it a shot.
5+
In case you need any help, just add a comment to the issue to get a conversation started. :smiley:
6+
7+
## Dev setup
8+
9+
Open this repo in VSCode, and you should be able to just Start the launch task "Launch Extension":
10+
11+
![screenshot](./assets/Screenshot%20launch%20task.png)
12+
13+
You might need to wait a moment for the first `npm install` to finish. You can see progress in the "running build tasks" section of VSCode:
14+
15+
![screenshot](./assets/Screenshot%20build%20task.png)
16+
17+
18+
## Packaging
19+
Run `make package` to package a `.vsix` file.
20+
21+
### additional commands
22+
To get a list of all available commands, try `make help`.
23+
To test your changes, go to the Debug panel in VSCode and click on the `play` button. This will start the extension in a new window where you can test it.

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ ls: ## Lists all the files that will be published
1515
vsce ls
1616

1717
.PHONY: package
18-
package: ## Package extension for publication
18+
package: install update-vsce ls ## Package extension for publication
1919
vsce package
2020

2121
.PHONY: update-vsce
2222
update-vsce: ## Update vsce extension manager
23-
npm install @vscode/vsce
23+
npm update @vscode/vsce
2424

2525
.PHONY: publish
2626
publish: update-vsce ls install package ## Publish on VSCode Marketplace

README.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,7 @@ You can move snippets or folders in the Snippets view by dragging and dropping t
115115

116116
![Preview](https://raw.githubusercontent.com/mre/vscode-snippet/master/contrib/snippets-storage/move.gif)
117117

118-
## Development
119-
120-
To get a list of all available commands, try `make help`.
121-
To test your changes, go to the Debug panel in VSCode and click on the `play` button. This will start the extension in a new window where you can test it.
122118

123119
## Contributing
124120

125-
This plugin is far from feature-complete.
126-
If you want to improve it, feel free to pick one of the [open issues](https://github.com/mre/vscode-snippet/issues) and give it a shot.
127-
In case you need any help, just add a comment to the issue to get a conversation started. :smiley:
121+
See [CONTRIBUTING.md](./CONTRIBUTING.md)

assets/Screenshot build task.png

8.08 KB
Loading

assets/Screenshot launch task.png

10.5 KB
Loading

0 commit comments

Comments
 (0)