This commit is contained in:
Mike Phares 2023-06-08 21:16:38 -07:00
parent d1e8f544c7
commit 0c0b5262bf
20 changed files with 7927 additions and 8886 deletions

4593
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}

View File

@ -1,4 +1,5 @@
out out
dist
node_modules node_modules
.vscode-test/ .vscode-test/
*.vsix *.vsix

View File

@ -1,7 +1,5 @@
{ {
// See http://go.microsoft.com/fwlink/?LinkId=827846 // See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format // for the documentation about the extensions.json format
"recommendations": [ "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
"ms-vscode.vscode-typescript-tslint-plugin" }
]
}

View File

@ -9,12 +9,11 @@
"name": "Run Extension", "name": "Run Extension",
"type": "extensionHost", "type": "extensionHost",
"request": "launch", "request": "launch",
"runtimeExecutable": "${execPath}",
"args": [ "args": [
"--extensionDevelopmentPath=${workspaceFolder}" "--extensionDevelopmentPath=${workspaceFolder}"
], ],
"outFiles": [ "outFiles": [
"${workspaceFolder}/out/**/*.js" "${workspaceFolder}/dist/**/*.js"
], ],
"preLaunchTask": "${defaultBuildTask}" "preLaunchTask": "${defaultBuildTask}"
}, },
@ -22,15 +21,15 @@
"name": "Extension Tests", "name": "Extension Tests",
"type": "extensionHost", "type": "extensionHost",
"request": "launch", "request": "launch",
"runtimeExecutable": "${execPath}",
"args": [ "args": [
"--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index" "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
], ],
"outFiles": [ "outFiles": [
"${workspaceFolder}/out/test/**/*.js" "${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/dist/**/*.js"
], ],
"preLaunchTask": "${defaultBuildTask}" "preLaunchTask": "tasks: watch-tests"
} }
] ]
} }

View File

@ -1,10 +1,12 @@
// Place your settings in this file to overwrite default and user settings. // Place your settings in this file to overwrite default and user settings.
{ {
"files.exclude": { "files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files "out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
}, },
"search.exclude": { "search.exclude": {
"out": true // set this to false to include "out" folder in search results "out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
}, },
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts // Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off" "typescript.tsc.autoDetect": "off"

View File

@ -6,15 +6,35 @@
{ {
"type": "npm", "type": "npm",
"script": "watch", "script": "watch",
"problemMatcher": "$tsc-watch", "problemMatcher": "$ts-webpack-watch",
"isBackground": true, "isBackground": true,
"presentation": { "presentation": {
"reveal": "never" "reveal": "never",
"group": "watchers"
}, },
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
} }
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
} }
] ]
} }

View File

@ -1,10 +1,13 @@
.vscode/** .vscode/**
.vscode-test/** .vscode-test/**
out/test/** out/**
node_modules/**
src/** src/**
.gitignore .gitignore
.yarnrc
webpack.config.js
vsc-extension-quickstart.md vsc-extension-quickstart.md
**/tsconfig.json **/tsconfig.json
**/tslint.json **/.eslintrc.json
**/*.map **/*.map
**/*.ts **/*.ts

View File

@ -1,14 +1,33 @@
# type-script-helper README # type-script-helper README
Helpers
## Features ## Features
See Contributions tab See Contributions tab
## Requirements ## Requirements
None ```bash
# https://code.visualstudio.com/api/get-started/your-first-extension
npm install -g yo generator-code
yo code
# ? What type of extension do you want to create? New Extension (TypeScript)
# ? What's the name of your extension? HelloWorld
### Press <Enter> to choose default for all options below ###
# ? What's the identifier of your extension? helloworld
# ? What's the description of your extension? LEAVE BLANK
# ? Initialize a git repository? Yes
# ? Bundle the source code with webpack? No
# ? Which package manager to use? npm
# ? Do you want to open the new folder with Visual Studio Code? Open with `code`
npm install -g @vscode/vsce
vsce package
```
## Extension Settings ## Extension Settings
@ -20,98 +39,52 @@ None
## Release Notes ## Release Notes
npm install -g vsce
npm install typescript --save-dev
L:
cd "L:\GitHub\YO-VSCode\type-script-helper"
npm install typescript
npx tsc
L:
cd "L:\GitHub\YO-VSCode\type-script-helper"
yo code
Type Script Helper
(type-script-helper)
Modify .package
Add publisher
cd "L:\GitHub\YO-VSCode\type-script-helper"
vsce package
F1
Extensions: Install from VSIX
## 1.0.0
Initial release of ...
## 1.0.1
Fixed issue in replace function
https://stackoverflow.com/questions/37197311/in-typescript-string-replace-only-replaces-first-occurrence-of-matched-string
Added split(' group by ').join('\r\n GROUP BY ').
## 1.1.0
-----------------------------------------------------------------------------------------------------------
Working with Markdown
For more information
## 1.2.4 ## 1.2.4
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
Search Google - Search Google
## 1.2.8 ## 1.2.8
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
Search Google (Read Only Lines Helper) - Search Google (Read Only Lines Helper)
## 1.2.9, 1.3.0, 1.3.1, 1.3.2 ## 1.2.9, 1.3.0, 1.3.1, 1.3.2
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
Quick Fix - Camel Case Properties - Quick Fix - Camel Case Properties
Quick Fix - CS0108 (Data Annotations) - Quick Fix - CS0108 (Data Annotations)
Quick Fix - Proper Case Properties - Quick Fix - Proper Case Properties
Quick Fix - Public (Expression Body) - Quick Fix - Public (Expression Body)
## 1.3.3, 1.3.4 ## 1.3.3, 1.3.4
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
Quick Fix - Instance Field to Calisthenics - Quick Fix - Instance Field to Calisthenics
## 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11 ## 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
Code Generator - Quick Pick {promiseLinesHelper.codeGeneratorQuickPick} - Code Generator - Quick Pick {promiseLinesHelper.codeGeneratorQuickPick}
Open in New Window {open-in-new-window.open} - Open in New Window {open-in-new-window.open}
Learned npm install will do similar to nuget restore - Learned npm install will do similar to nuget restore
Learned npm audit fix - Learned npm audit fix
Learned npm audit fix --force - Learned npm audit fix --force
Learned npm run compile will do similar to build - Learned npm run compile will do similar to build
- Quick Fix - Instance Field to Calisthenics
Quick Fix - Instance Field to Calisthenics
## 1.3.12, 1.3.13, 1.3.14 ## 1.3.12, 1.3.13, 1.3.14
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
Split by Space Reverse Join Sort lines (ascending, case sensitive) - Split by Space Reverse Join Sort lines (ascending, case sensitive)
PathWithoutBracketsSingularized - PathWithoutBracketsSingularized
## 1.3.15 ## 1.3.15
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
Distinct list - Distinct list
## 1.4.1
-----------------------------------------------------------------------------------------------------------
- new yo code template

File diff suppressed because it is too large Load Diff

View File

@ -1,177 +1,146 @@
{ {
"name": "type-script-helper", "name": "type-script-helper",
"displayName": "Type Script Helper", "displayName": "Type Script Helper",
"description": "Helper for VS Code in TypeScript", "description": "Helper for VS Code in TypeScript",
"publisher": "IFX", "publisher": "IFX",
"repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper", "repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper",
"version": "1.3.15", "version": "1.4.1",
"engines": { "engines": {
"vscode": "^1.40.0" "vscode": "^1.79.0"
}, },
"categories": [ "categories": [
"Other" "Other"
], ],
"main": "./out/extension.js", "activationEvents": [],
"activationEvents": [ "main": "./dist/extension.js",
"onCommand:open-in-new-window.open", "contributes": {
"onCommand:promiseLinesHelper.codeGeneratorQuickPick", "commands": [
"onCommand:readOnlyLinesHelper.searchGoogle", {
"onCommand:replaceLinesHelper.addCSharpComment", "command": "open-in-new-window.open",
"onCommand:replaceLinesHelper.addVBComment", "title": "Open in New Window"
"onCommand:replaceLinesHelper.convertToRegularExpression", },
"onCommand:replaceLinesHelper.cutEachLine", {
"onCommand:replaceLinesHelper.distinctLines", "command": "promiseLinesHelper.codeGeneratorQuickPick",
"onCommand:replaceLinesHelper.expandSql", "title": "Code Generator - Quick Pick"
"onCommand:replaceLinesHelper.listToListFamily", },
"onCommand:replaceLinesHelper.listToListWrappedComma", {
"onCommand:replaceLinesHelper.prettySql", "command": "readOnlyLinesHelper.searchGoogle",
"onCommand:replaceLinesHelper.quickFixCamelCaseProperties", "title": "Search Google"
"onCommand:replaceLinesHelper.quickFixCS0108", },
"onCommand:replaceLinesHelper.quickFixInstanceFieldToCalisthenics", {
"onCommand:replaceLinesHelper.quickFixProperCaseProperties", "command": "replaceLinesHelper.addCSharpComment",
"onCommand:replaceLinesHelper.quickFixPublic", "title": "Add C# Comment"
"onCommand:replaceLinesHelper.removeComment", },
"onCommand:replaceLinesHelper.sortLength", {
"onCommand:replaceLinesHelper.sortNormal", "command": "replaceLinesHelper.addVBComment",
"onCommand:replaceLinesHelper.splitBySpaceReverseJoinSort", "title": "Add VB Comment"
"onCommand:replaceLinesHelper.unwrapSql", },
"onCommand:replaceLinesHelper.wrapSqlCSharp", {
"onCommand:replaceLinesHelper.wrapSqlVB" "command": "replaceLinesHelper.convertToRegularExpression",
], "title": "Convert to Regular Expression"
"contributes": { },
"commands": [ {
{ "command": "replaceLinesHelper.cutEachLine",
"command": "open-in-new-window.open", "title": "Cut each line after |||"
"title": "Open in New Window" },
}, {
{ "command": "replaceLinesHelper.distinctLines",
"command": "promiseLinesHelper.codeGeneratorQuickPick", "title": "Distinct Lines"
"title": "Code Generator - Quick Pick" },
}, {
{ "command": "replaceLinesHelper.expandSql",
"command": "readOnlyLinesHelper.searchGoogle", "title": "Expand Sql"
"title": "Search Google" },
}, {
{ "command": "replaceLinesHelper.listToListFamily",
"command": "replaceLinesHelper.addCSharpComment", "title": "List to list family (Kristy, Mike ...)"
"title": "Add C# Comment" },
}, {
{ "command": "replaceLinesHelper.listToListWrappedComma",
"command": "replaceLinesHelper.addVBComment", "title": "List to list wrapped comma"
"title": "Add VB Comment" },
}, {
{ "command": "replaceLinesHelper.prettySql",
"command": "replaceLinesHelper.convertToRegularExpression", "title": "Pretty Sql"
"title": "Convert to Regular Expression" },
}, {
{ "command": "replaceLinesHelper.quickFixCamelCaseProperties",
"command": "replaceLinesHelper.cutEachLine", "title": "Quick Fix - Camel Case Properties"
"title": "Cut each line after |||" },
}, {
{ "command": "replaceLinesHelper.quickFixCS0108",
"command": "replaceLinesHelper.distinctLines", "title": "Quick Fix - CS0108 (Data Annotations)"
"title": "Distinct Lines" },
}, {
{ "command": "replaceLinesHelper.quickFixInstanceFieldToCalisthenics",
"command": "replaceLinesHelper.expandSql", "title": "Quick Fix - Instance Field to Calisthenics"
"title": "Expand Sql" },
}, {
{ "command": "replaceLinesHelper.quickFixProperCaseProperties",
"command": "replaceLinesHelper.listToListFamily", "title": "Quick Fix - Proper Case Properties"
"title": "List to list family (Kristy, Mike ...)" },
}, {
{ "command": "replaceLinesHelper.quickFixPublic",
"command": "replaceLinesHelper.listToListWrappedComma", "title": "Quick Fix - Public (Expression Body)"
"title": "List to list wrapped comma" },
}, {
{ "command": "replaceLinesHelper.removeComment",
"command": "replaceLinesHelper.prettySql", "title": "Remove comment"
"title": "Pretty Sql" },
}, {
{ "command": "replaceLinesHelper.sortLength",
"command": "replaceLinesHelper.quickFixCamelCaseProperties", "title": "Sort by Length"
"title": "Quick Fix - Camel Case Properties" },
}, {
{ "command": "replaceLinesHelper.sortNormal",
"command": "replaceLinesHelper.quickFixCS0108", "title": "My Sort lines (ascending, case sensitive)"
"title": "Quick Fix - CS0108 (Data Annotations)" },
}, {
{ "command": "replaceLinesHelper.splitBySpaceReverseJoinSort",
"command": "replaceLinesHelper.quickFixInstanceFieldToCalisthenics", "title": "Split by Space Reverse Join Sort lines (ascending, case sensitive)"
"title": "Quick Fix - Instance Field to Calisthenics" },
}, {
{ "command": "replaceLinesHelper.unwrapSql",
"command": "replaceLinesHelper.quickFixProperCaseProperties", "title": "Un-wrap Sql"
"title": "Quick Fix - Proper Case Properties" },
}, {
{ "command": "replaceLinesHelper.wrapSqlCSharp",
"command": "replaceLinesHelper.quickFixPublic", "title": "Wrap Sql for C#"
"title": "Quick Fix - Public (Expression Body)" },
}, {
{ "command": "replaceLinesHelper.wrapSqlVB",
"command": "replaceLinesHelper.removeComment", "title": "Wrap Sql for VB"
"title": "Remove comment" }
}, ]
{ },
"command": "replaceLinesHelper.sortLength", "scripts": {
"title": "Sort by Length" "vscode:prepublish": "npm run package",
}, "compile": "webpack",
{ "watch": "webpack --watch",
"command": "replaceLinesHelper.sortNormal", "package": "webpack --mode production --devtool hidden-source-map",
"title": "My Sort lines (ascending, case sensitive)" "compile-tests": "tsc -p . --outDir out",
}, "watch-tests": "tsc -p . -w --outDir out",
{ "pretest": "npm run compile-tests && npm run compile && npm run lint",
"command": "replaceLinesHelper.splitBySpaceReverseJoinSort", "lint": "eslint src --ext ts",
"title": "Split by Space Reverse Join Sort lines (ascending, case sensitive)" "test": "node ./out/test/runTest.js"
}, },
{ "devDependencies": {
"command": "replaceLinesHelper.unwrapSql", "@types/glob": "^8.1.0",
"title": "Un-wrap Sql" "@types/mocha": "^10.0.1",
}, "@types/node": "20.2.5",
{ "@types/vscode": "^1.79.0",
"command": "replaceLinesHelper.wrapSqlCSharp", "@typescript-eslint/eslint-plugin": "^5.59.8",
"title": "Wrap Sql for C#" "@typescript-eslint/parser": "^5.59.8",
}, "@vscode/test-electron": "^2.3.2",
{ "eslint": "^8.41.0",
"command": "replaceLinesHelper.wrapSqlVB", "glob": "^8.1.0",
"title": "Wrap Sql for VB" "mocha": "^10.2.0",
} "ts-loader": "^9.4.3",
], "typescript": "^5.1.3",
"menus": { "webpack": "^5.85.0",
"explorer/context": [ "webpack-cli": "^5.1.1"
{ },
"command": "open-in-new-window.open", "dependencies": {
"group": "openInNewWindowGroup" "@vscode/vsce": "^2.19.0"
} }
] }
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"test": "node ./out/test/runTest.js",
"prepublishOnly": "vsce package -o extension.vsix"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.7",
"@types/node": "^12.11.7",
"@types/vscode": "^1.40.0",
"glob": "^7.1.5",
"mocha": "^9.1.3",
"tslint": "^5.20.0",
"typescript": "^3.9.10",
"vscode-test": "^1.2.2"
},
"files": [
"type-script-helper-1.3.15.vsix"
],
"publishConfig": {
"registry": "http://localhost:4873/"
},
"dependencies": {
"vsce": "^2.15.0"
}
}

View File

@ -5,38 +5,26 @@ import * as replaceLinesHelper from './replaceLinesHelper';
import * as readOnlyLinesHelper from './readOnlyLinesHelper'; import * as readOnlyLinesHelper from './readOnlyLinesHelper';
import * as promiseLinesHelper from './promiseLinesHelper'; import * as promiseLinesHelper from './promiseLinesHelper';
// this method is called when your extension is activated // This method is called when your extension is activated
// your extension is activated the very first time the command is executed // Your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) { export function activate(context: vscode.ExtensionContext) {
const openCommand = 'open-in-new-window.open';
// Use the console to output diagnostic information (console.log) and errors (console.error) // 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 // This line of code will only be executed once when your extension is activated
console.log('Congratulations, your extension "type-script-helper" is now active!'); console.log('Congratulations, your extension "type-script-helper" is now active!');
// The command has been defined in the package.json file // // The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand // // Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json // // The commandId parameter must match the command field in package.json
// let disposable = vscode.commands.registerCommand('extension.helloWorld', () => { // let disposable = vscode.commands.registerCommand('type-script-helper.helloWorld', () => {
// // The code you place here will be executed every time your command is executed // // The code you place here will be executed every time your command is executed
// // Display a message box to the user // // Display a message box to the user
// vscode.window.showInformationMessage('Hello World!'); // vscode.window.showInformationMessage('Hello World from type-script-helper!');
// }); // });
// context.subscriptions.push(disposable); // context.subscriptions.push(disposable);
const commands = [ const commands = [
vscode.commands.registerCommand(openCommand, (uri) => {
if (!uri) {
vscode.window.showWarningMessage('The intended usage is from the explorer context menu.');
return;
}
vscode.window.showInformationMessage(`Opening ${uri.path} in new window!`);
vscode.commands.executeCommand('vscode.openFolder', uri, true);
}),
vscode.commands.registerCommand('promiseLinesHelper.codeGeneratorQuickPick', promiseLinesHelper.codeGeneratorQuickPick), vscode.commands.registerCommand('promiseLinesHelper.codeGeneratorQuickPick', promiseLinesHelper.codeGeneratorQuickPick),
vscode.commands.registerCommand('readOnlyLinesHelper.searchGoogle', readOnlyLinesHelper.searchGoogle), vscode.commands.registerCommand('readOnlyLinesHelper.searchGoogle', readOnlyLinesHelper.searchGoogle),
vscode.commands.registerCommand('replaceLinesHelper.addCSharpComment', replaceLinesHelper.addCSharpComment), vscode.commands.registerCommand('replaceLinesHelper.addCSharpComment', replaceLinesHelper.addCSharpComment),
@ -65,5 +53,5 @@ export function activate(context: vscode.ExtensionContext) {
commands.forEach(command => context.subscriptions.push(command)); commands.forEach(command => context.subscriptions.push(command));
} }
// this method is called when your extension is deactivated // This method is called when your extension is deactivated
export function deactivate() { } export function deactivate() { }

View File

@ -1,5 +1,4 @@
import * as vscode from 'vscode'; import * as vscode from 'vscode';
import { QuickPickItem } from "vscode";
function codeGeneratorQuickPickLogic(): undefined { function codeGeneratorQuickPickLogic(): undefined {
const textEditor = vscode.window.activeTextEditor; const textEditor = vscode.window.activeTextEditor;

View File

@ -1,6 +1,6 @@
import * as path from 'path'; import * as path from 'path';
import { runTests } from 'vscode-test'; import { runTests } from '@vscode/test-electron';
async function main() { async function main() {
try { try {
@ -15,7 +15,7 @@ async function main() {
// Download VS Code, unzip it and run the integration test // Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath }); await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) { } catch (err) {
console.error('Failed to run tests'); console.error('Failed to run tests', err);
process.exit(1); process.exit(1);
} }
} }

View File

@ -3,13 +3,13 @@ import * as assert from 'assert';
// You can import and use all API from the 'vscode' module // You can import and use all API from the 'vscode' module
// as well as import your extension to test it // as well as import your extension to test it
import * as vscode from 'vscode'; import * as vscode from 'vscode';
// import * as myExtension from '../extension'; // import * as myExtension from '../../extension';
suite('Extension Test Suite', () => { suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.'); vscode.window.showInformationMessage('Start all tests.');
test('Sample test', () => { test('Sample test', () => {
assert.equal(-1, [1, 2, 3].indexOf(5)); assert.strictEqual(-1, [1, 2, 3].indexOf(5));
assert.equal(-1, [1, 2, 3].indexOf(0)); assert.strictEqual(-1, [1, 2, 3].indexOf(0));
}); });
}); });

View File

@ -6,8 +6,8 @@ export function run(): Promise<void> {
// Create the mocha test // Create the mocha test
const mocha = new Mocha({ const mocha = new Mocha({
ui: 'tdd', ui: 'tdd',
color: true
}); });
mocha.useColors(true);
const testsRoot = path.resolve(__dirname, '..'); const testsRoot = path.resolve(__dirname, '..');
@ -30,6 +30,7 @@ export function run(): Promise<void> {
} }
}); });
} catch (err) { } catch (err) {
console.error(err);
e(err); e(err);
} }
}); });

View File

@ -1,22 +1,16 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"target": "es6", "target": "ES2020",
"outDir": "out",
"lib": [ "lib": [
"es6" "ES2020"
], ],
"sourceMap": true, "sourceMap": true,
"rootDir": "src", "rootDir": "src",
"resolveJsonModule": true,
"strict": true /* enable all strict type-checking options */ "strict": true /* enable all strict type-checking options */
/* Additional Checks */ /* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */ // "noUnusedParameters": true, /* Report errors on unused parameters. */
}, }
"exclude": [
"node_modules",
".vscode-test"
]
} }

View File

@ -1,15 +0,0 @@
{
"rules": {
"no-string-throw": true,
"no-unused-expression": true,
"no-duplicate-variable": true,
"curly": true,
"class-name": true,
"semicolon": [
true,
"always"
],
"triple-equals": true
},
"defaultSeverity": "warning"
}

View File

@ -9,6 +9,11 @@
* 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`. * 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`. * We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
## Setup
* install the recommended extensions (amodio.tsl-problem-matcher and dbaeumer.vscode-eslint)
## Get up and running straight away ## Get up and running straight away
* Press `F5` to open a new window with your extension loaded. * Press `F5` to open a new window with your extension loaded.
@ -37,6 +42,6 @@
## Go further ## Go further
* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension). * 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 VSCode extension marketplace. * [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). * Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).

View File

@ -0,0 +1,48 @@
//@ts-check
'use strict';
const path = require('path');
//@ts-check
/** @typedef {import('webpack').Configuration} WebpackConfig **/
/** @type WebpackConfig */
const extensionConfig = {
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2'
},
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
// modules added here also need to be added in the .vscodeignore file
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader'
}
]
}
]
},
devtool: 'nosources-source-map',
infrastructureLogging: {
level: "log", // enables logging required for problem matchers
},
};
module.exports = [ extensionConfig ];