fix build issue

This commit is contained in:
machunyu 2022-09-13 16:18:48 +08:00
parent 5a53346553
commit b93dfd7244
11 changed files with 53 additions and 6 deletions

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

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

1
detect-plugin/.yarnrc Normal file
View File

@ -0,0 +1 @@
--ignore-engines true

View File

@ -0,0 +1 @@
MIT

View File

@ -2,22 +2,28 @@
"name": "deadlock-detect", "name": "deadlock-detect",
"displayName": "deadlock-detect", "displayName": "deadlock-detect",
"description": "Deadlock detect for C/C++ program which use the posix thread library for Linux system platform.", "description": "Deadlock detect for C/C++ program which use the posix thread library for Linux system platform.",
"publisher": "kylin-code",
"version": "0.0.1", "version": "0.0.1",
"engines": { "engines": {
"vscode": "^1.54.0" "vscode": "^1.54.0"
}, },
"license": "SEE LICENSE IN LICENSE.txt",
"repository": {
"type": "git",
"url": "https://gitee.com/openkylin/deadlock-detect.git"
},
"categories": [ "categories": [
"Other" "Other"
], ],
"activationEvents": [ "activationEvents": [
"onCommand:deadlock-detect.open" "onCommand:deadlock-detect.detect"
], ],
"main": "./out/extension.js", "main": "./out/extension.js",
"contributes": { "contributes": {
"commands": [ "commands": [
{ {
"command": "deadlock-detect.open", "command": "deadlock-detect.detect",
"title": "C/C++ 死锁检测" "title": "C/C++程序死锁检测"
} }
] ]
}, },

View File

@ -10,6 +10,9 @@ function getWebViewContent(context: vscode.ExtensionContext, templatePath: strin
let html = fs.readFileSync(resourcePath, 'utf-8'); let html = fs.readFileSync(resourcePath, 'utf-8');
// vscode不支持直接加载本地资源需要替换成其专有路径格式这里只是简单的将样式和JS的路径替换 // vscode不支持直接加载本地资源需要替换成其专有路径格式这里只是简单的将样式和JS的路径替换
html = html.replace(/(<link.+?href="|<script.+?src="|<img.+?src=")(.+?)"/g, (m, $1, $2) => { html = html.replace(/(<link.+?href="|<script.+?src="|<img.+?src=")(.+?)"/g, (m, $1, $2) => {
if($2[0] === '/'){
$2 = "." + $2;
}
return $1 + vscode.Uri.file(path.resolve(dirPath, $2)).with({ scheme: 'vscode-resource' }).toString() + '"'; return $1 + vscode.Uri.file(path.resolve(dirPath, $2)).with({ scheme: 'vscode-resource' }).toString() + '"';
}); });
return html; return html;
@ -26,7 +29,7 @@ export function activate(context: vscode.ExtensionContext) {
// 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('deadlock-detect.open', () => { let disposable = vscode.commands.registerCommand('deadlock-detect.detect', () => {
// 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
const panel = vscode.window.createWebviewPanel( const panel = vscode.window.createWebviewPanel(
@ -38,7 +41,7 @@ export function activate(context: vscode.ExtensionContext) {
retainContextWhenHidden: false, retainContextWhenHidden: false,
} }
); );
panel.webview.html = getWebViewContent(context, "src/dist/index.html"); panel.webview.html = getWebViewContent(context, "./dist/index.html");
}); });
context.subscriptions.push(disposable); context.subscriptions.push(disposable);

View File

@ -171,7 +171,7 @@
resolved "https://registry.npmmirror.com/@types/node/-/node-16.11.58.tgz#0a3698dee3492617a8d5fe7998d18d7520b63026" resolved "https://registry.npmmirror.com/@types/node/-/node-16.11.58.tgz#0a3698dee3492617a8d5fe7998d18d7520b63026"
integrity sha512-uMVxJ111wpHzkx/vshZFb6Qni3BOMnlWLq7q9jrwej7Yw/KvjsEbpxCCxw+hLKxexFMc8YmpG8J9tnEe/rKsIg== integrity sha512-uMVxJ111wpHzkx/vshZFb6Qni3BOMnlWLq7q9jrwej7Yw/KvjsEbpxCCxw+hLKxexFMc8YmpG8J9tnEe/rKsIg==
"@types/vscode@^1.71.0": "@types/vscode@^1.54.0":
version "1.71.0" version "1.71.0"
resolved "https://registry.npmmirror.com/@types/vscode/-/vscode-1.71.0.tgz#a8d9bb7aca49b0455060e6eb978711b510bdd2e2" resolved "https://registry.npmmirror.com/@types/vscode/-/vscode-1.71.0.tgz#a8d9bb7aca49b0455060e6eb978711b510bdd2e2"
integrity sha512-nB50bBC9H/x2CpwW9FzRRRDrTZ7G0/POttJojvN/LiVfzTGfLyQIje1L1QRMdFXK9G41k5UJN/1B9S4of7CSzA== integrity sha512-nB50bBC9H/x2CpwW9FzRRRDrTZ7G0/POttJojvN/LiVfzTGfLyQIje1L1QRMdFXK9G41k5UJN/1B9S4of7CSzA==