Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
languages
snippets
syntaxes
out
vendor
package-lock.json
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"singleQuote": true,
"tabWidth": 2,
"endOfLine": "lf",
"printWidth": 120,
"useTabs": false,
"trailingComma": "all",
"semi": true,
}
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"eamodio.gitlens",
"esbenp.prettier-vscode",
"ms-vscode.vscode-typescript-tslint-plugin",
"wwm.better-align",
"rebornix.Ruby"
Expand Down
18 changes: 6 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
Expand All @@ -27,9 +23,7 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
Expand All @@ -38,8 +32,8 @@
"name": "DebugAdapter",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/src/debugAdapter.ts",
"args": [ "--server=4711" ],
"outFiles": [ "${workspaceFolder}/out/**/*.js" ]
"args": ["--server=4711"],
"outFiles": ["${workspaceFolder}/out/**/*.js"]
},
{
"type": "node",
Expand All @@ -56,7 +50,7 @@
"compounds": [
{
"name": "Extension + DebugAdapter",
"configurations": [ "Extension", "DebugAdapter" ]
"configurations": ["Extension", "DebugAdapter"]
}
]
}
52 changes: 27 additions & 25 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
// Place your settings in this file to overwrite default and user settings.
{
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.trimAutoWhitespace": true,

"files.encoding": "utf8",
// The default end of line character. Use \n for LF and \r\n for CRLF.
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": false,
"files.exclude": {
"node_modules": true,
"out": true, // set this to true to hide the "out" folder with the compiled JS files
".vscode-test": true
},
"search.exclude": {
"node_modules": true,
"out": true // set this to false to include "out" folder in search results
},

"prettier.printWidth": 120,
"prettier.singleQuote": true,
"prettier.tabWidth": 2,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.trimAutoWhitespace": true,

// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
"files.encoding": "utf8",
// The default end of line character. Use \n for LF and \r\n for CRLF.
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": false,
"files.exclude": {
"node_modules": true,
"out": true, // set this to true to hide the "out" folder with the compiled JS files
".vscode-test": true
},
"search.exclude": {
"node_modules": true,
"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",
"typescript.format.enable": false,
"[typescript]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

- ([GH-649](https://github.com/puppetlabs/puppet-vscode/issues/649)) Reduce activation events for extension
- ([GH-639](https://github.com/puppetlabs/puppet-vscode/issues/639)) Deprecate Bolt Commands
- ([GH-643](https://github.com/puppetlabs/puppet-vscode/issues/643)) Enable, configure and run prettier

## [0.26.1] - 2020-05-12

Expand Down
54 changes: 27 additions & 27 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ function generate_cy_stylesheet(cy) {
{
selector: 'node',
style: {
label: "data(id)",
shape: "round-rectangle",
"background-color": html_style.getPropertyValue('--vscode-button-background'),
"background-width": "90%",
"background-height": "90%",
width: "228",
height: "128",
"border-width": "0",
}
label: 'data(id)',
shape: 'round-rectangle',
'background-color': html_style.getPropertyValue('--vscode-button-background'),
'background-width': '90%',
'background-height': '90%',
width: '228',
height: '128',
'border-width': '0',
},
},
{
selector: 'label',
Expand All @@ -27,8 +27,8 @@ function generate_cy_stylesheet(cy) {
'font-family': '"Segoe UI", Arial, Helvetica, sans-serif',
'font-size': '28vh',
'text-valign': 'center',
'text-halign': 'center'
}
'text-halign': 'center',
},
},
{
selector: ':selected',
Expand All @@ -38,18 +38,18 @@ function generate_cy_stylesheet(cy) {
'background-color': html_style.getPropertyValue('--vscode-button-hoverBackground'),
'line-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight'),
'target-arrow-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight'),
'source-arrow-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight')
}
'source-arrow-color': html_style.getPropertyValue('--vscode-minimap-errorHighlight'),
},
},
{
selector: 'edge',
style: {
'target-arrow-shape': 'triangle',
'curve-style': 'bezier',
'control-point-step-size': 40,
width: 10
}
}
width: 10,
},
},
])
.update(); // indicate the end of your new stylesheet so that it can be updated on elements
}
Expand All @@ -62,42 +62,42 @@ function init() {
wheelSensitivity: 0.15,
maxZoom: 5,
minZoom: 0.2,
selectionType: 'single'
selectionType: 'single',
});

generate_cy_stylesheet(cy);

vscode.postMessage({ command: 'initialized' });
}

window.addEventListener('message', event => {
window.addEventListener('message', (event) => {
const message = event.data;
if(message.redraw == true){
if (message.redraw == true) {
cy.remove('*');
}

nodeGraph = message.content;

try {
nodeGraph.vertices.forEach(element => {
try {
nodeGraph.vertices.forEach((element) => {
cy.add({
data: { id: element.label }
data: { id: element.label },
});
});

nodeGraph.edges.forEach(element => {
nodeGraph.edges.forEach((element) => {
cy.add({
data: {
id: element.source + element.target,
source: element.source,
target: element.target
}
target: element.target,
},
});
});
} catch (error) {
vscode.postMessage({
command: 'error',
errorMsg: `Error building node graph from json graph data: ${error}`
errorMsg: `Error building node graph from json graph data: ${error}`,
});
}

Expand All @@ -107,6 +107,6 @@ window.addEventListener('message', event => {
circle: false,
nodeDimensionsIncludeLabels: true,
spacingFactor: 1.5,
animate: true
animate: true,
}).run();
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@
"build": "pwsh -file ./build.ps1",
"watch": "npm run build && tsc -watch -p ./",
"pretest": "npm run compile",
"test": "node ./out/test/runtest.js"
"test": "node ./out/test/runtest.js",
"format": "prettier --write '**/**/*.{ts,js,json}'"
},
"devDependencies": {
"@types/glob": "^7.1.1",
Expand Down
12 changes: 9 additions & 3 deletions snippets/puppetfile.snippets.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"Forge_module1": {
"prefix": "Forge Module",
"body": ["mod '${1:author}-${2:name}', '${3:version}'"],
"body": [
"mod '${1:author}-${2:name}', '${3:version}'"
],
"description": "Install from the forge"
},
"Forge_module2": {
"prefix": "Latest Forge Module",
"body": ["mod '${1:author}-${2:name}', :latest"],
"body": [
"mod '${1:author}-${2:name}', :latest"
],
"description": "Install the latest version from the forge"
},
"Git_module1": {
Expand Down Expand Up @@ -46,7 +50,9 @@
},
"Local_module1": {
"prefix": "Local Module",
"body": ["mod '${1:name}', :local => true"],
"body": [
"mod '${1:name}', :local => true"
],
"description": "Install from the local Puppetfile module path"
}
}
Loading