1.4.1
This commit is contained in:
parent
d1e8f544c7
commit
0c0b5262bf
4593
package-lock.json
generated
4593
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
type-script-helper/.eslintrc.json
Normal file
24
type-script-helper/.eslintrc.json
Normal 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"
|
||||
]
|
||||
}
|
1
type-script-helper/.gitignore
vendored
1
type-script-helper/.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
out
|
||||
dist
|
||||
node_modules
|
||||
.vscode-test/
|
||||
*.vsix
|
||||
|
10
type-script-helper/.vscode/extensions.json
vendored
10
type-script-helper/.vscode/extensions.json
vendored
@ -1,7 +1,5 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"ms-vscode.vscode-typescript-tslint-plugin"
|
||||
]
|
||||
}
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
|
||||
}
|
||||
|
9
type-script-helper/.vscode/launch.json
vendored
9
type-script-helper/.vscode/launch.json
vendored
@ -9,12 +9,11 @@
|
||||
"name": "Run Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "${defaultBuildTask}"
|
||||
},
|
||||
@ -22,15 +21,15 @@
|
||||
"name": "Extension Tests",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/test/**/*.js"
|
||||
"${workspaceFolder}/out/**/*.js",
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "${defaultBuildTask}"
|
||||
"preLaunchTask": "tasks: watch-tests"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
6
type-script-helper/.vscode/settings.json
vendored
6
type-script-helper/.vscode/settings.json
vendored
@ -1,10 +1,12 @@
|
||||
// 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
|
||||
"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": {
|
||||
"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
|
||||
"typescript.tsc.autoDetect": "off"
|
||||
|
24
type-script-helper/.vscode/tasks.json
vendored
24
type-script-helper/.vscode/tasks.json
vendored
@ -6,15 +6,35 @@
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "watch",
|
||||
"problemMatcher": "$tsc-watch",
|
||||
"problemMatcher": "$ts-webpack-watch",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"reveal": "never"
|
||||
"reveal": "never",
|
||||
"group": "watchers"
|
||||
},
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"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": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,10 +1,13 @@
|
||||
.vscode/**
|
||||
.vscode-test/**
|
||||
out/test/**
|
||||
out/**
|
||||
node_modules/**
|
||||
src/**
|
||||
.gitignore
|
||||
.yarnrc
|
||||
webpack.config.js
|
||||
vsc-extension-quickstart.md
|
||||
**/tsconfig.json
|
||||
**/tslint.json
|
||||
**/.eslintrc.json
|
||||
**/*.map
|
||||
**/*.ts
|
||||
**/*.ts
|
||||
|
@ -1,14 +1,33 @@
|
||||
# type-script-helper README
|
||||
|
||||
Helpers
|
||||
|
||||
## Features
|
||||
|
||||
See Contributions tab
|
||||
|
||||
## 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
|
||||
|
||||
@ -20,98 +39,52 @@ None
|
||||
|
||||
## 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
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
Search Google
|
||||
- Search Google
|
||||
|
||||
## 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
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
Quick Fix - Camel Case Properties
|
||||
Quick Fix - CS0108 (Data Annotations)
|
||||
Quick Fix - Proper Case Properties
|
||||
Quick Fix - Public (Expression Body)
|
||||
- Quick Fix - Camel Case Properties
|
||||
- Quick Fix - CS0108 (Data Annotations)
|
||||
- Quick Fix - Proper Case Properties
|
||||
- Quick Fix - Public (Expression Body)
|
||||
|
||||
## 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
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
Code Generator - Quick Pick {promiseLinesHelper.codeGeneratorQuickPick}
|
||||
Open in New Window {open-in-new-window.open}
|
||||
Learned npm install will do similar to nuget restore
|
||||
Learned npm audit fix
|
||||
Learned npm audit fix --force
|
||||
Learned npm run compile will do similar to build
|
||||
|
||||
Quick Fix - Instance Field to Calisthenics
|
||||
- Code Generator - Quick Pick {promiseLinesHelper.codeGeneratorQuickPick}
|
||||
- Open in New Window {open-in-new-window.open}
|
||||
- Learned npm install will do similar to nuget restore
|
||||
- Learned npm audit fix
|
||||
- Learned npm audit fix --force
|
||||
- Learned npm run compile will do similar to build
|
||||
- Quick Fix - Instance Field to Calisthenics
|
||||
|
||||
## 1.3.12, 1.3.13, 1.3.14
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
Split by Space Reverse Join Sort lines (ascending, case sensitive)
|
||||
PathWithoutBracketsSingularized
|
||||
- Split by Space Reverse Join Sort lines (ascending, case sensitive)
|
||||
- PathWithoutBracketsSingularized
|
||||
|
||||
## 1.3.15
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
Distinct list
|
||||
- Distinct list
|
||||
|
||||
## 1.4.1
|
||||
-----------------------------------------------------------------------------------------------------------
|
||||
|
||||
- new yo code template
|
11573
type-script-helper/package-lock.json
generated
11573
type-script-helper/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,177 +1,146 @@
|
||||
{
|
||||
"name": "type-script-helper",
|
||||
"displayName": "Type Script Helper",
|
||||
"description": "Helper for VS Code in TypeScript",
|
||||
"publisher": "IFX",
|
||||
"repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper",
|
||||
"version": "1.3.15",
|
||||
"engines": {
|
||||
"vscode": "^1.40.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"activationEvents": [
|
||||
"onCommand:open-in-new-window.open",
|
||||
"onCommand:promiseLinesHelper.codeGeneratorQuickPick",
|
||||
"onCommand:readOnlyLinesHelper.searchGoogle",
|
||||
"onCommand:replaceLinesHelper.addCSharpComment",
|
||||
"onCommand:replaceLinesHelper.addVBComment",
|
||||
"onCommand:replaceLinesHelper.convertToRegularExpression",
|
||||
"onCommand:replaceLinesHelper.cutEachLine",
|
||||
"onCommand:replaceLinesHelper.distinctLines",
|
||||
"onCommand:replaceLinesHelper.expandSql",
|
||||
"onCommand:replaceLinesHelper.listToListFamily",
|
||||
"onCommand:replaceLinesHelper.listToListWrappedComma",
|
||||
"onCommand:replaceLinesHelper.prettySql",
|
||||
"onCommand:replaceLinesHelper.quickFixCamelCaseProperties",
|
||||
"onCommand:replaceLinesHelper.quickFixCS0108",
|
||||
"onCommand:replaceLinesHelper.quickFixInstanceFieldToCalisthenics",
|
||||
"onCommand:replaceLinesHelper.quickFixProperCaseProperties",
|
||||
"onCommand:replaceLinesHelper.quickFixPublic",
|
||||
"onCommand:replaceLinesHelper.removeComment",
|
||||
"onCommand:replaceLinesHelper.sortLength",
|
||||
"onCommand:replaceLinesHelper.sortNormal",
|
||||
"onCommand:replaceLinesHelper.splitBySpaceReverseJoinSort",
|
||||
"onCommand:replaceLinesHelper.unwrapSql",
|
||||
"onCommand:replaceLinesHelper.wrapSqlCSharp",
|
||||
"onCommand:replaceLinesHelper.wrapSqlVB"
|
||||
],
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "open-in-new-window.open",
|
||||
"title": "Open in New Window"
|
||||
},
|
||||
{
|
||||
"command": "promiseLinesHelper.codeGeneratorQuickPick",
|
||||
"title": "Code Generator - Quick Pick"
|
||||
},
|
||||
{
|
||||
"command": "readOnlyLinesHelper.searchGoogle",
|
||||
"title": "Search Google"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.addCSharpComment",
|
||||
"title": "Add C# Comment"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.addVBComment",
|
||||
"title": "Add VB Comment"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.convertToRegularExpression",
|
||||
"title": "Convert to Regular Expression"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.cutEachLine",
|
||||
"title": "Cut each line after |||"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.distinctLines",
|
||||
"title": "Distinct Lines"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.expandSql",
|
||||
"title": "Expand Sql"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.listToListFamily",
|
||||
"title": "List to list family (Kristy, Mike ...)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.listToListWrappedComma",
|
||||
"title": "List to list wrapped comma"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.prettySql",
|
||||
"title": "Pretty Sql"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixCamelCaseProperties",
|
||||
"title": "Quick Fix - Camel Case Properties"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixCS0108",
|
||||
"title": "Quick Fix - CS0108 (Data Annotations)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixInstanceFieldToCalisthenics",
|
||||
"title": "Quick Fix - Instance Field to Calisthenics"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixProperCaseProperties",
|
||||
"title": "Quick Fix - Proper Case Properties"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixPublic",
|
||||
"title": "Quick Fix - Public (Expression Body)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.removeComment",
|
||||
"title": "Remove comment"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.sortLength",
|
||||
"title": "Sort by Length"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.sortNormal",
|
||||
"title": "My Sort lines (ascending, case sensitive)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.splitBySpaceReverseJoinSort",
|
||||
"title": "Split by Space Reverse Join Sort lines (ascending, case sensitive)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.unwrapSql",
|
||||
"title": "Un-wrap Sql"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.wrapSqlCSharp",
|
||||
"title": "Wrap Sql for C#"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.wrapSqlVB",
|
||||
"title": "Wrap Sql for VB"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"explorer/context": [
|
||||
{
|
||||
"command": "open-in-new-window.open",
|
||||
"group": "openInNewWindowGroup"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
"name": "type-script-helper",
|
||||
"displayName": "Type Script Helper",
|
||||
"description": "Helper for VS Code in TypeScript",
|
||||
"publisher": "IFX",
|
||||
"repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper",
|
||||
"version": "1.4.1",
|
||||
"engines": {
|
||||
"vscode": "^1.79.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [],
|
||||
"main": "./dist/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "open-in-new-window.open",
|
||||
"title": "Open in New Window"
|
||||
},
|
||||
{
|
||||
"command": "promiseLinesHelper.codeGeneratorQuickPick",
|
||||
"title": "Code Generator - Quick Pick"
|
||||
},
|
||||
{
|
||||
"command": "readOnlyLinesHelper.searchGoogle",
|
||||
"title": "Search Google"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.addCSharpComment",
|
||||
"title": "Add C# Comment"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.addVBComment",
|
||||
"title": "Add VB Comment"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.convertToRegularExpression",
|
||||
"title": "Convert to Regular Expression"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.cutEachLine",
|
||||
"title": "Cut each line after |||"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.distinctLines",
|
||||
"title": "Distinct Lines"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.expandSql",
|
||||
"title": "Expand Sql"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.listToListFamily",
|
||||
"title": "List to list family (Kristy, Mike ...)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.listToListWrappedComma",
|
||||
"title": "List to list wrapped comma"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.prettySql",
|
||||
"title": "Pretty Sql"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixCamelCaseProperties",
|
||||
"title": "Quick Fix - Camel Case Properties"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixCS0108",
|
||||
"title": "Quick Fix - CS0108 (Data Annotations)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixInstanceFieldToCalisthenics",
|
||||
"title": "Quick Fix - Instance Field to Calisthenics"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixProperCaseProperties",
|
||||
"title": "Quick Fix - Proper Case Properties"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.quickFixPublic",
|
||||
"title": "Quick Fix - Public (Expression Body)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.removeComment",
|
||||
"title": "Remove comment"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.sortLength",
|
||||
"title": "Sort by Length"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.sortNormal",
|
||||
"title": "My Sort lines (ascending, case sensitive)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.splitBySpaceReverseJoinSort",
|
||||
"title": "Split by Space Reverse Join Sort lines (ascending, case sensitive)"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.unwrapSql",
|
||||
"title": "Un-wrap Sql"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.wrapSqlCSharp",
|
||||
"title": "Wrap Sql for C#"
|
||||
},
|
||||
{
|
||||
"command": "replaceLinesHelper.wrapSqlVB",
|
||||
"title": "Wrap Sql for VB"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run package",
|
||||
"compile": "webpack",
|
||||
"watch": "webpack --watch",
|
||||
"package": "webpack --mode production --devtool hidden-source-map",
|
||||
"compile-tests": "tsc -p . --outDir out",
|
||||
"watch-tests": "tsc -p . -w --outDir out",
|
||||
"pretest": "npm run compile-tests && npm run compile && npm run lint",
|
||||
"lint": "eslint src --ext ts",
|
||||
"test": "node ./out/test/runTest.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^8.1.0",
|
||||
"@types/mocha": "^10.0.1",
|
||||
"@types/node": "20.2.5",
|
||||
"@types/vscode": "^1.79.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
||||
"@typescript-eslint/parser": "^5.59.8",
|
||||
"@vscode/test-electron": "^2.3.2",
|
||||
"eslint": "^8.41.0",
|
||||
"glob": "^8.1.0",
|
||||
"mocha": "^10.2.0",
|
||||
"ts-loader": "^9.4.3",
|
||||
"typescript": "^5.1.3",
|
||||
"webpack": "^5.85.0",
|
||||
"webpack-cli": "^5.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vscode/vsce": "^2.19.0"
|
||||
}
|
||||
}
|
@ -5,38 +5,26 @@ import * as replaceLinesHelper from './replaceLinesHelper';
|
||||
import * as readOnlyLinesHelper from './readOnlyLinesHelper';
|
||||
import * as promiseLinesHelper from './promiseLinesHelper';
|
||||
|
||||
// this method is called when your extension is activated
|
||||
// your extension is activated the very first time the command is executed
|
||||
// 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) {
|
||||
|
||||
const openCommand = 'open-in-new-window.open';
|
||||
|
||||
// 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 "type-script-helper" 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 disposable = vscode.commands.registerCommand('extension.helloWorld', () => {
|
||||
// // 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 disposable = vscode.commands.registerCommand('type-script-helper.helloWorld', () => {
|
||||
// // The code you place here will be executed every time your command is executed
|
||||
|
||||
// // 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);
|
||||
|
||||
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('readOnlyLinesHelper.searchGoogle', readOnlyLinesHelper.searchGoogle),
|
||||
vscode.commands.registerCommand('replaceLinesHelper.addCSharpComment', replaceLinesHelper.addCSharpComment),
|
||||
@ -65,5 +53,5 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
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() { }
|
||||
|
@ -1,5 +1,4 @@
|
||||
import * as vscode from 'vscode';
|
||||
import { QuickPickItem } from "vscode";
|
||||
|
||||
function codeGeneratorQuickPickLogic(): undefined {
|
||||
const textEditor = vscode.window.activeTextEditor;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as path from 'path';
|
||||
|
||||
import { runTests } from 'vscode-test';
|
||||
import { runTests } from '@vscode/test-electron';
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
@ -15,7 +15,7 @@ async function main() {
|
||||
// Download VS Code, unzip it and run the integration test
|
||||
await runTests({ extensionDevelopmentPath, extensionTestsPath });
|
||||
} catch (err) {
|
||||
console.error('Failed to run tests');
|
||||
console.error('Failed to run tests', err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ 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';
|
||||
// import * as myExtension from '../../extension';
|
||||
|
||||
suite('Extension Test Suite', () => {
|
||||
vscode.window.showInformationMessage('Start all tests.');
|
||||
|
||||
test('Sample test', () => {
|
||||
assert.equal(-1, [1, 2, 3].indexOf(5));
|
||||
assert.equal(-1, [1, 2, 3].indexOf(0));
|
||||
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
|
||||
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
|
||||
});
|
||||
});
|
||||
|
@ -6,8 +6,8 @@ export function run(): Promise<void> {
|
||||
// Create the mocha test
|
||||
const mocha = new Mocha({
|
||||
ui: 'tdd',
|
||||
color: true
|
||||
});
|
||||
mocha.useColors(true);
|
||||
|
||||
const testsRoot = path.resolve(__dirname, '..');
|
||||
|
||||
@ -30,6 +30,7 @@ export function run(): Promise<void> {
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
e(err);
|
||||
}
|
||||
});
|
||||
|
@ -1,22 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"outDir": "out",
|
||||
"target": "ES2020",
|
||||
"lib": [
|
||||
"es6"
|
||||
"ES2020"
|
||||
],
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"resolveJsonModule": true,
|
||||
"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. */
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
".vscode-test"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
@ -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`.
|
||||
* 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
|
||||
|
||||
* Press `F5` to open a new window with your extension loaded.
|
||||
@ -37,6 +42,6 @@
|
||||
|
||||
## 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).
|
||||
* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VSCode extension marketplace.
|
||||
* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
|
||||
* 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).
|
||||
|
48
type-script-helper/webpack.config.js
Normal file
48
type-script-helper/webpack.config.js
Normal 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 ];
|
Loading…
x
Reference in New Issue
Block a user