initial commit
This commit is contained in:
parent
50648532e7
commit
49b5625d75
30
.eslintrc.json
Normal file
30
.eslintrc.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 6,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"@typescript-eslint"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"@typescript-eslint/naming-convention": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
"selector": "import",
|
||||||
|
"format": [ "camelCase", "PascalCase" ]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@typescript-eslint/semi": "warn",
|
||||||
|
"curly": "warn",
|
||||||
|
"eqeqeq": "warn",
|
||||||
|
"no-throw-literal": "warn",
|
||||||
|
"semi": "off"
|
||||||
|
},
|
||||||
|
"ignorePatterns": [
|
||||||
|
"out",
|
||||||
|
"dist",
|
||||||
|
"**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -12,3 +12,8 @@
|
|||||||
# Built Visual Studio Code Extensions
|
# Built Visual Studio Code Extensions
|
||||||
*.vsix
|
*.vsix
|
||||||
|
|
||||||
|
# Extra Stuff
|
||||||
|
out
|
||||||
|
dist
|
||||||
|
node_modules
|
||||||
|
.vscode-test/
|
||||||
|
|||||||
7
.vscode/extensions.json
vendored
Normal file
7
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||||
|
// for the documentation about the extensions.json format
|
||||||
|
"recommendations": [
|
||||||
|
"dbaeumer.vscode-eslint"
|
||||||
|
]
|
||||||
|
}
|
||||||
34
.vscode/launch.json
vendored
Normal file
34
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// A launch configuration that compiles the extension and then opens it inside a new window
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Run Extension",
|
||||||
|
"type": "extensionHost",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||||
|
],
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceFolder}/out/**/*.js"
|
||||||
|
],
|
||||||
|
"preLaunchTask": "${defaultBuildTask}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Extension Tests",
|
||||||
|
"type": "extensionHost",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||||
|
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
|
||||||
|
],
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceFolder}/out/test/**/*.js"
|
||||||
|
],
|
||||||
|
"preLaunchTask": "${defaultBuildTask}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
11
.vscode/settings.json
vendored
Normal file
11
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Place your settings in this file to overwrite default and user settings.
|
||||||
|
{
|
||||||
|
"files.exclude": {
|
||||||
|
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||||
|
},
|
||||||
|
"search.exclude": {
|
||||||
|
"out": true // set this to false to include "out" folder in search results
|
||||||
|
},
|
||||||
|
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
|
||||||
|
"typescript.tsc.autoDetect": "off"
|
||||||
|
}
|
||||||
20
.vscode/tasks.json
vendored
Normal file
20
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "watch",
|
||||||
|
"problemMatcher": "$tsc-watch",
|
||||||
|
"isBackground": true,
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "never"
|
||||||
|
},
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
10
.vscodeignore
Normal file
10
.vscodeignore
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.vscode/**
|
||||||
|
.vscode-test/**
|
||||||
|
src/**
|
||||||
|
.gitignore
|
||||||
|
.yarnrc
|
||||||
|
vsc-extension-quickstart.md
|
||||||
|
**/tsconfig.json
|
||||||
|
**/.eslintrc.json
|
||||||
|
**/*.map
|
||||||
|
**/*.ts
|
||||||
9
CHANGELOG.md
Normal file
9
CHANGELOG.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Change Log
|
||||||
|
|
||||||
|
All notable changes to the "suvmanager" extension will be documented in this file.
|
||||||
|
|
||||||
|
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
- Initial release
|
||||||
72
README.md
72
README.md
@ -1,3 +1,71 @@
|
|||||||
# mocha-vscode
|
# suvmanager README
|
||||||
|
|
||||||
VSCode/VSCodium extension for accessing Mocha Advanced Database Infrastructure systems
|
This is the README for your extension "suvmanager". After writing up a brief description, we recommend including the following sections.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
|
||||||
|
|
||||||
|
For example if there is an image subfolder under your extension project workspace:
|
||||||
|
|
||||||
|
\!\[feature X\]\(images/feature-x.png\)
|
||||||
|
|
||||||
|
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
|
||||||
|
|
||||||
|
## Extension Settings
|
||||||
|
|
||||||
|
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
This extension contributes the following settings:
|
||||||
|
|
||||||
|
* `myExtension.enable`: Enable/disable this extension.
|
||||||
|
* `myExtension.thing`: Set to `blah` to do something.
|
||||||
|
|
||||||
|
## Known Issues
|
||||||
|
|
||||||
|
Calling out known issues can help limit users opening duplicate issues against your extension.
|
||||||
|
|
||||||
|
## Release Notes
|
||||||
|
|
||||||
|
Users appreciate release notes as you update your extension.
|
||||||
|
|
||||||
|
### 1.0.0
|
||||||
|
|
||||||
|
Initial release of ...
|
||||||
|
|
||||||
|
### 1.0.1
|
||||||
|
|
||||||
|
Fixed issue #.
|
||||||
|
|
||||||
|
### 1.1.0
|
||||||
|
|
||||||
|
Added features X, Y, and Z.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Following extension guidelines
|
||||||
|
|
||||||
|
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
|
||||||
|
|
||||||
|
* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
|
||||||
|
|
||||||
|
## Working with Markdown
|
||||||
|
|
||||||
|
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
|
||||||
|
|
||||||
|
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
|
||||||
|
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
|
||||||
|
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.
|
||||||
|
|
||||||
|
## For more information
|
||||||
|
|
||||||
|
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
|
||||||
|
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
|
||||||
|
|
||||||
|
**Enjoy!**
|
||||||
|
|||||||
161
mocha.svg
Normal file
161
mocha.svg
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="40.212135mm"
|
||||||
|
height="38.277172mm"
|
||||||
|
viewBox="0 0 40.212135 38.277172"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||||
|
sodipodi:docname="mocha.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<defs
|
||||||
|
id="defs2">
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient4640"
|
||||||
|
inkscape:swatch="solid">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#000000;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop4638" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient4634"
|
||||||
|
inkscape:swatch="solid">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#000000;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop4632" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient4628"
|
||||||
|
inkscape:swatch="solid">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#000000;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop4626" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient4622"
|
||||||
|
inkscape:swatch="solid">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#6a4113;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop4620" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient4622"
|
||||||
|
id="linearGradient4624"
|
||||||
|
x1="107.32299"
|
||||||
|
y1="94.538285"
|
||||||
|
x2="147.53512"
|
||||||
|
y2="94.538285"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(0.77191419,0,0,0.9430219,29.993759,4.9132861)" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient4622"
|
||||||
|
id="linearGradient4630"
|
||||||
|
x1="112.2664"
|
||||||
|
y1="74.646065"
|
||||||
|
x2="115.72621"
|
||||||
|
y2="74.646065"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(0.77191419,0,0,0.9430219,29.993759,4.9132861)" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient4622"
|
||||||
|
id="linearGradient4636"
|
||||||
|
x1="121.03449"
|
||||||
|
y1="74.646065"
|
||||||
|
x2="124.4943"
|
||||||
|
y2="74.646065"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(0.77191419,0,0,0.9430219,29.993759,4.9132861)" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient4622"
|
||||||
|
id="linearGradient4642"
|
||||||
|
x1="129.57092"
|
||||||
|
y1="74.427536"
|
||||||
|
x2="133.03076"
|
||||||
|
y2="74.427536"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(0.77191419,0,0,0.9430219,29.993759,4.9132861)" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="2.3545454"
|
||||||
|
inkscape:cx="101.71815"
|
||||||
|
inkscape:cy="63.91892"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
inkscape:window-width="1452"
|
||||||
|
inkscape:window-height="752"
|
||||||
|
inkscape:window-x="118"
|
||||||
|
inkscape:window-y="114"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-107.32299,-65.404171)">
|
||||||
|
<path
|
||||||
|
style="fill:url(#linearGradient4636);fill-opacity:1;stroke-width:0.292672"
|
||||||
|
d="m 123.48341,83.732235 c 0,-0.12933 0.2383,-0.805831 0.52957,-1.503326 0.68131,-1.631519 0.66991,-3.407536 -0.0401,-6.273127 -0.73772,-2.976866 -0.73427,-5.734938 0.0104,-7.789842 0.63545,-1.75499 0.95225,-1.841203 0.55551,-0.151175 -0.49083,2.090759 -0.30619,3.942703 0.66649,6.684779 1.06241,2.994984 1.14111,4.196296 0.39786,6.071978 -0.4854,1.224999 -2.11899,3.507489 -2.11899,2.960718 z"
|
||||||
|
id="path3724-7"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cccccsccc" />
|
||||||
|
<path
|
||||||
|
style="fill:url(#linearGradient4624);fill-opacity:1;stroke:none;stroke-width:0.208358;stroke-opacity:1"
|
||||||
|
d="m 118.79358,101.05448 -0.82457,-0.63769 c -2.04661,-1.582763 -3.73849,-5.054945 -4.81621,-9.884135 -0.42946,-1.924333 -0.41763,-4.322519 0.0232,-4.703482 0.27634,-0.23882 2.66692,-0.303954 13.1813,-0.359148 14.38451,-0.0755 14.12479,-0.09897 15.74668,1.422627 2.88177,2.703585 2.14548,7.339986 -1.42814,8.992878 -0.70958,0.328199 -1.27393,0.386637 -3.26778,0.338362 -3.10649,-0.07519 -3.48414,0.08237 -4.35905,1.818929 -0.76993,1.528199 -1.1782,2.552509 -2.02631,3.039449 3.48565,1.87867 -15.14601,2.39621 -12.22908,-0.0278 z m 21.62456,-6.699903 c 2.37612,-1.261629 2.64908,-4.78947 0.50242,-6.493556 -1.08996,-0.865251 -2.95466,-0.987788 -3.98174,-0.261662 -0.63476,0.448744 -0.75006,0.681481 -1.03588,2.091101 -0.17691,0.872389 -0.38925,1.887447 -0.47185,2.255686 -0.12816,0.571094 -0.0515,0.786578 0.52148,1.465737 0.36944,0.437919 0.94912,0.922023 1.2882,1.075791 0.91012,0.412731 2.2555,0.356373 3.17737,-0.133097 z"
|
||||||
|
id="path3724-5"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="csccsccccccccccccccc" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cccccsccc"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path3786"
|
||||||
|
d="m 130.07281,83.526153 c 0,-0.12933 0.2383,-0.805831 0.52957,-1.503328 0.68132,-1.631517 0.66993,-3.407532 -0.0402,-6.273124 -0.73774,-2.976867 -0.73428,-5.734939 0.0104,-7.789843 0.63545,-1.754989 0.95224,-1.841203 0.55549,-0.151175 -0.49082,2.090759 -0.30618,3.942702 0.6665,6.684779 1.06241,2.994985 1.14112,4.196296 0.39787,6.07198 -0.4854,1.224997 -2.119,3.507487 -2.119,2.960717 z"
|
||||||
|
style="fill:url(#linearGradient4642);fill-opacity:1;stroke-width:0.292672" />
|
||||||
|
<path
|
||||||
|
style="fill:url(#linearGradient4630);fill-opacity:1;stroke-width:0.292672"
|
||||||
|
d="m 116.71518,83.732235 c 0,-0.12933 0.23831,-0.805831 0.52958,-1.503326 0.68131,-1.631518 0.66994,-3.407533 -0.0402,-6.273126 -0.73772,-2.976866 -0.73426,-5.734939 0.0104,-7.789842 0.63544,-1.754989 0.95224,-1.841204 0.55549,-0.15119 -0.49082,2.09076 -0.30619,3.942702 0.66651,6.68478 1.06239,2.994984 1.1411,4.196296 0.39786,6.071978 -0.48542,1.224999 -2.11901,3.507488 -2.11901,2.960717 z"
|
||||||
|
id="path3794"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
sodipodi:nodetypes="cccccsccc" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 6.9 KiB |
2634
package-lock.json
generated
Normal file
2634
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
89
package.json
Normal file
89
package.json
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
{
|
||||||
|
"name": "mochacodium",
|
||||||
|
"displayName": "Mocha VSCodium Extension",
|
||||||
|
"description": "Manage Mocha SUVs and interact with ZQ from your IDE",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"engines": {
|
||||||
|
"vscode": "^1.84.0"
|
||||||
|
},
|
||||||
|
"categories": [
|
||||||
|
"Other"
|
||||||
|
],
|
||||||
|
"activationEvents": [],
|
||||||
|
"main": "./out/extension.js",
|
||||||
|
"contributes": {
|
||||||
|
"commands": [
|
||||||
|
{
|
||||||
|
"command": "suvmanager.suv_manager",
|
||||||
|
"title": "Mocha: SUV Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "suvmanager.suv_up",
|
||||||
|
"title": "Mocha: SUV Up"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mocha.add_documentation_comment",
|
||||||
|
"title": "Mocha: Add Documentation Comment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mocha.add_extension_qualifier",
|
||||||
|
"title": "Mocha: Add Extension Qualifier"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mocha.publish_zq_stub_with_implementation",
|
||||||
|
"title": "Mocha: Publish as ZQ stub and upload implementation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mocha.publish_zq_stub",
|
||||||
|
"title": "Mocha: Publish as ZQ stub method"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mocha.import_function_implementation_from_zq",
|
||||||
|
"title": "Mocha: Import Function Implementation from ZQ"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"viewsContainers": {
|
||||||
|
"activitybar": [
|
||||||
|
{
|
||||||
|
"id": "mocha",
|
||||||
|
"icon": "mocha.svg",
|
||||||
|
"title": "Mocha"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"views": {
|
||||||
|
"mocha": [
|
||||||
|
{
|
||||||
|
"id": "mocha.suvManager",
|
||||||
|
"name": "SUV Manager",
|
||||||
|
"type": "tree"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "mocha.moduleExplorer",
|
||||||
|
"name": "Module Explorer",
|
||||||
|
"type": "tree"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"vscode:prepublish": "npm run compile",
|
||||||
|
"compile": "tsc -p ./",
|
||||||
|
"watch": "tsc -watch -p ./",
|
||||||
|
"pretest": "npm run compile && npm run lint",
|
||||||
|
"lint": "eslint src --ext ts",
|
||||||
|
"test": "node ./out/test/runTest.js"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/vscode": "^1.84.0",
|
||||||
|
"@types/mocha": "^10.0.3",
|
||||||
|
"@types/node": "18.x",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
||||||
|
"@typescript-eslint/parser": "^6.9.0",
|
||||||
|
"eslint": "^8.52.0",
|
||||||
|
"glob": "^10.3.10",
|
||||||
|
"mocha": "^10.2.0",
|
||||||
|
"typescript": "^5.2.2",
|
||||||
|
"@vscode/test-electron": "^2.3.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/Machine.ts
Normal file
13
src/Machine.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
export class Machine
|
||||||
|
{
|
||||||
|
|
||||||
|
private _name : string = "";
|
||||||
|
public get name() : string {
|
||||||
|
return this._name;
|
||||||
|
}
|
||||||
|
public set name(v : string) {
|
||||||
|
this._name = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
75
src/SuvManagerTreeDataProvider.ts
Normal file
75
src/SuvManagerTreeDataProvider.ts
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
import * as vscode from 'vscode';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
import { Machine } from './Machine';
|
||||||
|
|
||||||
|
const cp = require('child_process')
|
||||||
|
|
||||||
|
export class SuvManagerTreeDataProvider implements vscode.TreeDataProvider<Machine> {
|
||||||
|
|
||||||
|
|
||||||
|
private _treeview : vscode.TreeView<Machine> | null = null;
|
||||||
|
public get treeview() : vscode.TreeView<Machine> | null
|
||||||
|
{
|
||||||
|
return this._treeview;
|
||||||
|
}
|
||||||
|
public set treeview(v : vscode.TreeView<Machine>)
|
||||||
|
{
|
||||||
|
this._treeview = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getTreeItem(element: Machine): vscode.TreeItem {
|
||||||
|
return new vscode.TreeItem(element.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
getChildren(element?: Machine): Thenable<Machine[]> {
|
||||||
|
if (element) {
|
||||||
|
return Promise.resolve(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return new Promise((resolve, reject) =>
|
||||||
|
{
|
||||||
|
cp.exec('mocha suv list', (err: string, stdout: string, stderr: string) =>
|
||||||
|
{
|
||||||
|
let listSuvs = new Array<Machine>();
|
||||||
|
let list = stdout.split(' ');
|
||||||
|
if (list.length == 0)
|
||||||
|
{
|
||||||
|
if (this.treeview != null)
|
||||||
|
{
|
||||||
|
this.treeview.message = "No items to show here";
|
||||||
|
this.treeview.badge = { "value": 0, "tooltip": "No SUVs available" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let ct = 0;
|
||||||
|
|
||||||
|
list.forEach( (element) =>
|
||||||
|
{
|
||||||
|
let m1 = new Machine();
|
||||||
|
m1.name = element.trim();
|
||||||
|
ct ++;
|
||||||
|
|
||||||
|
listSuvs.push(m1);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.treeview != null)
|
||||||
|
{
|
||||||
|
this.treeview.badge = { "value": ct, "tooltip": ct.toString() + " SUV(s) running" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resolve(listSuvs);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return Promise.resolve([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
59
src/extension.ts
Normal file
59
src/extension.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
// The module 'vscode' contains the VS Code extensibility API
|
||||||
|
// Import the module and reference it with the alias vscode in your code below
|
||||||
|
import * as vscode from 'vscode';
|
||||||
|
|
||||||
|
import { SuvManagerTreeDataProvider } from './SuvManagerTreeDataProvider';
|
||||||
|
|
||||||
|
// This method is called when your extension is activated
|
||||||
|
// Your extension is activated the very first time the command is executed
|
||||||
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
|
|
||||||
|
let treeDataProvider = new SuvManagerTreeDataProvider();
|
||||||
|
let treeSuvManager = vscode.window.createTreeView("mocha.suvManager", { "canSelectMany": true, "showCollapseAll": true, "treeDataProvider": treeDataProvider });
|
||||||
|
treeDataProvider.treeview = treeSuvManager;
|
||||||
|
|
||||||
|
treeSuvManager.badge = { "value": 1, "tooltip": "1 SUV(s) running" };
|
||||||
|
|
||||||
|
// Use the console to output diagnostic information (console.log) and errors (console.error)
|
||||||
|
// This line of code will only be executed once when your extension is activated
|
||||||
|
console.log('Congratulations, your extension "suvmanager" is now active!');
|
||||||
|
|
||||||
|
// The command has been defined in the package.json file
|
||||||
|
// Now provide the implementation of the command with registerCommand
|
||||||
|
// The commandId parameter must match the command field in package.json
|
||||||
|
let cmd_suv_manager = vscode.commands.registerCommand('suvmanager.suv_manager', () => {
|
||||||
|
// The code you place here will be executed every time your command is executed
|
||||||
|
// Display a message box to the user
|
||||||
|
|
||||||
|
vscode.window.showInformationMessage('Add code here to display SUV Manager panel!');
|
||||||
|
});
|
||||||
|
context.subscriptions.push(cmd_suv_manager);
|
||||||
|
|
||||||
|
let cmd_suv_up = vscode.commands.registerCommand('suvmanager.suv_up', () => {
|
||||||
|
// The code you place here will be executed every time your command is executed
|
||||||
|
// Display a message box to the user
|
||||||
|
const cp = require('child_process')
|
||||||
|
cp.exec('mocha suv list', (err: string, stdout: string, stderr: string) =>
|
||||||
|
{
|
||||||
|
let list = stdout.split(' ');
|
||||||
|
let list2 = new Array<string>();
|
||||||
|
list.forEach( (element) =>
|
||||||
|
{
|
||||||
|
list2.push(element.trim());
|
||||||
|
});
|
||||||
|
|
||||||
|
var w = vscode.window.showQuickPick(list2, { "title": "Launch SUV", "placeHolder": "Pick an SUV to launch (e.g. i-012345678)" }).then((value) =>
|
||||||
|
{
|
||||||
|
cp.exec("mocha suv up " + value, (err2: string, stdout2: string, stderr2: string) =>
|
||||||
|
{
|
||||||
|
vscode.window.showInformationMessage('Selected SUV ( ' + value + ' ) launched successfully!');
|
||||||
|
});
|
||||||
|
vscode.window.showInformationMessage('Selected SUV ( ' + value + ' ) is launching now!');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
context.subscriptions.push(cmd_suv_up);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This method is called when your extension is deactivated
|
||||||
|
export function deactivate() {}
|
||||||
23
src/test/runTest.ts
Normal file
23
src/test/runTest.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
import { runTests } from '@vscode/test-electron';
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
try {
|
||||||
|
// The folder containing the Extension Manifest package.json
|
||||||
|
// Passed to `--extensionDevelopmentPath`
|
||||||
|
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
|
||||||
|
|
||||||
|
// The path to test runner
|
||||||
|
// Passed to --extensionTestsPath
|
||||||
|
const extensionTestsPath = path.resolve(__dirname, './suite/index');
|
||||||
|
|
||||||
|
// Download VS Code, unzip it and run the integration test
|
||||||
|
await runTests({ extensionDevelopmentPath, extensionTestsPath });
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to run tests', err);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
15
src/test/suite/extension.test.ts
Normal file
15
src/test/suite/extension.test.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import * as assert from 'assert';
|
||||||
|
|
||||||
|
// You can import and use all API from the 'vscode' module
|
||||||
|
// as well as import your extension to test it
|
||||||
|
import * as vscode from 'vscode';
|
||||||
|
// import * as myExtension from '../../extension';
|
||||||
|
|
||||||
|
suite('Extension Test Suite', () => {
|
||||||
|
vscode.window.showInformationMessage('Start all tests.');
|
||||||
|
|
||||||
|
test('Sample test', () => {
|
||||||
|
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
|
||||||
|
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
|
||||||
|
});
|
||||||
|
});
|
||||||
32
src/test/suite/index.ts
Normal file
32
src/test/suite/index.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
import Mocha from 'mocha';
|
||||||
|
import { glob } from 'glob';
|
||||||
|
|
||||||
|
export async function run(): Promise<void> {
|
||||||
|
// Create the mocha test
|
||||||
|
const mocha = new Mocha({
|
||||||
|
ui: 'tdd',
|
||||||
|
color: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const testsRoot = path.resolve(__dirname, '..');
|
||||||
|
const files = await glob('**/**.test.js', { cwd: testsRoot });
|
||||||
|
|
||||||
|
// Add files to the test suite
|
||||||
|
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
|
||||||
|
|
||||||
|
try {
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
// Run the mocha test
|
||||||
|
mocha.run(failures => {
|
||||||
|
if (failures > 0) {
|
||||||
|
e(new Error(`${failures} tests failed.`));
|
||||||
|
} else {
|
||||||
|
c();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
47
suvicon.svg
Normal file
47
suvicon.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 16 KiB |
17
tsconfig.json
Normal file
17
tsconfig.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "Node16",
|
||||||
|
"target": "ES2022",
|
||||||
|
"outDir": "out",
|
||||||
|
"lib": [
|
||||||
|
"ES2022"
|
||||||
|
],
|
||||||
|
"sourceMap": true,
|
||||||
|
"rootDir": "src",
|
||||||
|
"strict": true /* enable all strict type-checking options */
|
||||||
|
/* Additional Checks */
|
||||||
|
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||||
|
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||||
|
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||||
|
}
|
||||||
|
}
|
||||||
42
vsc-extension-quickstart.md
Normal file
42
vsc-extension-quickstart.md
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Welcome to your VS Code Extension
|
||||||
|
|
||||||
|
## What's in the folder
|
||||||
|
|
||||||
|
* This folder contains all of the files necessary for your extension.
|
||||||
|
* `package.json` - this is the manifest file in which you declare your extension and command.
|
||||||
|
* The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
|
||||||
|
* `src/extension.ts` - this is the main file where you will provide the implementation of your command.
|
||||||
|
* The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
|
||||||
|
* We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
|
||||||
|
|
||||||
|
## Get up and running straight away
|
||||||
|
|
||||||
|
* Press `F5` to open a new window with your extension loaded.
|
||||||
|
* Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`.
|
||||||
|
* Set breakpoints in your code inside `src/extension.ts` to debug your extension.
|
||||||
|
* Find output from your extension in the debug console.
|
||||||
|
|
||||||
|
## Make changes
|
||||||
|
|
||||||
|
* You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`.
|
||||||
|
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
|
||||||
|
|
||||||
|
## Explore the API
|
||||||
|
|
||||||
|
* You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`.
|
||||||
|
|
||||||
|
## Run tests
|
||||||
|
|
||||||
|
* Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
|
||||||
|
* Press `F5` to run the tests in a new window with your extension loaded.
|
||||||
|
* See the output of the test result in the debug console.
|
||||||
|
* Make changes to `src/test/suite/extension.test.ts` or create new test files inside the `test/suite` folder.
|
||||||
|
* The provided test runner will only consider files matching the name pattern `**.test.ts`.
|
||||||
|
* You can create folders inside the `test` folder to structure your tests any way you want.
|
||||||
|
|
||||||
|
## Go further
|
||||||
|
|
||||||
|
* [Follow UX guidelines](https://code.visualstudio.com/api/ux-guidelines/overview) to create extensions that seamlessly integrate with VS Code's native interface and patterns.
|
||||||
|
* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension).
|
||||||
|
* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VS Code extension marketplace.
|
||||||
|
* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
|
||||||
Loading…
x
Reference in New Issue
Block a user