Skip to content

Commit 643ba09

Browse files
committedApr 28, 2022
⬆️ 更新文档和依赖
根据VSCode测试组件变化,更新测试路径
1 parent 17b2e22 commit 643ba09

File tree

5 files changed

+1552
-1406
lines changed

5 files changed

+1552
-1406
lines changed
 

‎.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1010
"typescript.tsc.autoDetect": "off",
11-
"editor.formatOnSave": true,
11+
// "editor.formatOnSave": true,
1212
"markdownlint.config": {
1313
"MD033": false
1414
}

‎CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
[email](mailto:xsro@foxmail.com?subject=VSCode_Extension(xsro.masm-tasm)_report&body=hello)|[issue](https://github.com/dosasm/masm-tasm/issues)
44

5+
### 1.1.0 Fix format 修复格式化时还原的问题
6+
7+
Thanks to [Asttear][github:Asttear] for debugging and fixing [#37][issue:37]
8+
9+
修复格式化的时候文档被还原为初始文档的问题[#37][issue:37]。该bug影响较广,非常抱歉。
10+
感谢[Asttear][github:Asttear]报告并帮助修复:heart:
11+
12+
[github:Asttear]: https://github.com/Asttear
13+
[issue:37]: https://github.com/dosasm/masm-tasm/issues/37 "格式化时文件被还原"
14+
515
## 1.0 Web Extension Support 浏览器端支持
616

717
![web extension Demo](pics/demo_web-russiacube.gif)

‎package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "MASM/TASM",
44
"publisher": "xsro",
55
"description": "run MASM/TASM assembly in DOSBox 汇编语言开发插件",
6-
"version": "1.0.2",
6+
"version": "1.1.0",
77
"keywords": [
88
"dosbox",
99
"16位",
@@ -369,13 +369,14 @@
369369
"@types/webpack-env": "^1.16.2",
370370
"@typescript-eslint/eslint-plugin": "^5.2.0",
371371
"@typescript-eslint/parser": "^5.2.0",
372-
"@vscode/test-web": "^0.0.15",
372+
"@vscode/test-electron": "^2.1.3",
373+
"@vscode/test-web": "^0.0.24",
373374
"assert": "^2.0.0",
374375
"del": "^6.0.0",
375376
"download": "^8.0.0",
376377
"emulators": "^0.72.0",
377378
"eslint": "^8.1.0",
378-
"glob": "^7.2.0",
379+
"glob": "^8.0.1",
379380
"js-yaml": "^4.0.0",
380381
"jszip": "^3.7.1",
381382
"mocha": "^9.1.3",
@@ -385,7 +386,6 @@
385386
"rimraf": "^3.0.2",
386387
"ts-loader": "^9.2.6",
387388
"typescript": "^4.4.4",
388-
"vscode-test": "^1.4.1",
389389
"vscode-uri": "^3.0.2",
390390
"webpack": "^5.60.0",
391391
"webpack-cli": "^4.9.1"
@@ -399,4 +399,4 @@
399399
"email": "xsro@foxmail.com"
400400
},
401401
"license": "MIT"
402-
}
402+
}

‎src/test/runTest.ts

+46-44
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,61 @@ import * as path from 'path';
77
import * as fs from "fs";
88
import {
99
downloadAndUnzipVSCode,
10-
resolveCliPathFromVSCodeExecutablePath,
10+
resolveCliArgsFromVSCodeExecutablePath,
1111
runTests
12-
} from 'vscode-test';
12+
} from '@vscode/test-electron';
1313

14-
async function main() {
15-
try {
16-
const extensionDevelopmentPath = path.resolve(__dirname, '../../../');
17-
const extensionTestsPath = path.resolve(__dirname, './suite/index');
18-
const vscodeExecutablePath = await downloadAndUnzipVSCode('stable');
19-
const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);
14+
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
15+
const extensionTestsPath = path.resolve(__dirname, './suite/index.js');
2016

21-
const extensions = [
22-
"xsro.vscode-dosbox"
23-
];
17+
async function test(version:string){
18+
const vscodeExecutablePath = await downloadAndUnzipVSCode(version);
19+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
20+
const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
2421

25-
const vscedosbox = path.resolve(__dirname, "../..", "..", "vscode-dosbox");
26-
if (fs.existsSync(vscedosbox)) {
27-
const dirs = await fs.promises.readdir(vscedosbox);
28-
const dir = dirs.find(val => val.includes(`vscode-dosbox-${process.platform}-${process.arch}`));
29-
if (dir) {
30-
console.log("found " + dir);
31-
extensions[0] = path.resolve(vscedosbox, dir);
32-
}
33-
}
22+
const extensions = [
23+
"xsro.vscode-dosbox"
24+
];
3425

35-
// Use cp.spawn / cp.exec for custom setup
36-
const p1 = cp.spawnSync(cliPath, ['--install-extension', ...extensions], {
37-
encoding: 'utf-8',
38-
stdio: 'inherit'
39-
});
26+
const vscedosbox = path.resolve(__dirname, "../..", "..", "vscode-dosbox");
27+
if (fs.existsSync(vscedosbox)) {
28+
const dirs = await fs.promises.readdir(vscedosbox);
29+
const dir = dirs.find(val => val.includes(`vscode-dosbox-${process.platform}-${process.arch}`));
30+
if (dir) {
31+
console.log("found " + dir);
32+
extensions[0] = path.resolve(vscedosbox, dir);
33+
}
34+
}
4035

41-
// Use cp.spawn / cp.exec for custom setup
42-
const p2 = cp.spawnSync(cliPath, ["--list-extensions", "--show-versions"], {
43-
encoding: 'utf-8',
44-
stdio: 'inherit'
45-
});
36+
// Use cp.spawn / cp.exec for custom setup
37+
cp.spawnSync(cli, [...args,'--install-extension', ...extensions], {
38+
encoding: 'utf-8',
39+
stdio: 'inherit'
40+
});
4641

47-
console.log(p1, p2);
42+
const sampleFolder = path.resolve(__dirname, '../../samples');
43+
const launchArgs: string[] = [
44+
"--disable-workspace-trust",
45+
sampleFolder
46+
];
4847

49-
const sampleFolder = path.resolve(__dirname, '../../samples');
50-
const launchArgs: string[] = [
51-
"--disable-workspace-trust",
52-
sampleFolder
53-
];
48+
// Run the extension test
49+
await runTests({
50+
// Use the specified `code` executable
51+
vscodeExecutablePath,
52+
extensionDevelopmentPath,
53+
extensionTestsPath,
54+
launchArgs
55+
});
56+
}
5457

55-
// Run the extension test
56-
await runTests({
57-
// Use the specified `code` executable
58-
vscodeExecutablePath,
59-
extensionDevelopmentPath,
60-
extensionTestsPath,
61-
launchArgs
62-
});
58+
async function main() {
59+
try {
60+
await test('stable');
61+
const pack=fs.readFileSync(path.resolve( extensionDevelopmentPath,"package.json"),"utf-8")
62+
const least=JSON.parse(pack).engines.vscode.replace("^","");
63+
await test(least);
64+
6365
} catch (err) {
6466
console.error('Failed to run tests');
6567
process.exit(1);

0 commit comments

Comments
 (0)
Failed to load comments.