Skip to content

Commit

Permalink
⬆️ 更新文档和依赖
Browse files Browse the repository at this point in the history
根据VSCode测试组件变化,更新测试路径
  • Loading branch information
xsro committed Apr 28, 2022
1 parent 17b2e22 commit 643ba09
Show file tree
Hide file tree
Showing 5 changed files with 1,552 additions and 1,406 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"editor.formatOnSave": true,
// "editor.formatOnSave": true,
"markdownlint.config": {
"MD033": false
}
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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

### 1.1.0 Fix format 修复格式化时还原的问题

Thanks to [Asttear][github:Asttear] for debugging and fixing [#37][issue:37]

修复格式化的时候文档被还原为初始文档的问题[#37][issue:37]。该bug影响较广,非常抱歉。
感谢[Asttear][github:Asttear]报告并帮助修复:heart:

[github:Asttear]: https://github.com/Asttear
[issue:37]: https://github.com/dosasm/masm-tasm/issues/37 "格式化时文件被还原"

## 1.0 Web Extension Support 浏览器端支持

![web extension Demo](pics/demo_web-russiacube.gif)
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "MASM/TASM",
"publisher": "xsro",
"description": "run MASM/TASM assembly in DOSBox 汇编语言开发插件",
"version": "1.0.2",
"version": "1.1.0",
"keywords": [
"dosbox",
"16位",
Expand Down Expand Up @@ -369,13 +369,14 @@
"@types/webpack-env": "^1.16.2",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"@vscode/test-web": "^0.0.15",
"@vscode/test-electron": "^2.1.3",
"@vscode/test-web": "^0.0.24",
"assert": "^2.0.0",
"del": "^6.0.0",
"download": "^8.0.0",
"emulators": "^0.72.0",
"eslint": "^8.1.0",
"glob": "^7.2.0",
"glob": "^8.0.1",
"js-yaml": "^4.0.0",
"jszip": "^3.7.1",
"mocha": "^9.1.3",
Expand All @@ -385,7 +386,6 @@
"rimraf": "^3.0.2",
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
"vscode-test": "^1.4.1",
"vscode-uri": "^3.0.2",
"webpack": "^5.60.0",
"webpack-cli": "^4.9.1"
Expand All @@ -399,4 +399,4 @@
"email": "[email protected]"
},
"license": "MIT"
}
}
90 changes: 46 additions & 44 deletions src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,61 @@ import * as path from 'path';
import * as fs from "fs";
import {
downloadAndUnzipVSCode,
resolveCliPathFromVSCodeExecutablePath,
resolveCliArgsFromVSCodeExecutablePath,
runTests
} from 'vscode-test';
} from '@vscode/test-electron';

async function main() {
try {
const extensionDevelopmentPath = path.resolve(__dirname, '../../../');
const extensionTestsPath = path.resolve(__dirname, './suite/index');
const vscodeExecutablePath = await downloadAndUnzipVSCode('stable');
const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
const extensionTestsPath = path.resolve(__dirname, './suite/index.js');

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

const vscedosbox = path.resolve(__dirname, "../..", "..", "vscode-dosbox");
if (fs.existsSync(vscedosbox)) {
const dirs = await fs.promises.readdir(vscedosbox);
const dir = dirs.find(val => val.includes(`vscode-dosbox-${process.platform}-${process.arch}`));
if (dir) {
console.log("found " + dir);
extensions[0] = path.resolve(vscedosbox, dir);
}
}
const extensions = [
"xsro.vscode-dosbox"
];

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

// Use cp.spawn / cp.exec for custom setup
const p2 = cp.spawnSync(cliPath, ["--list-extensions", "--show-versions"], {
encoding: 'utf-8',
stdio: 'inherit'
});
// Use cp.spawn / cp.exec for custom setup
cp.spawnSync(cli, [...args,'--install-extension', ...extensions], {
encoding: 'utf-8',
stdio: 'inherit'
});

console.log(p1, p2);
const sampleFolder = path.resolve(__dirname, '../../samples');
const launchArgs: string[] = [
"--disable-workspace-trust",
sampleFolder
];

const sampleFolder = path.resolve(__dirname, '../../samples');
const launchArgs: string[] = [
"--disable-workspace-trust",
sampleFolder
];
// Run the extension test
await runTests({
// Use the specified `code` executable
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath,
launchArgs
});
}

// Run the extension test
await runTests({
// Use the specified `code` executable
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath,
launchArgs
});
async function main() {
try {
await test('stable');
const pack=fs.readFileSync(path.resolve( extensionDevelopmentPath,"package.json"),"utf-8")
const least=JSON.parse(pack).engines.vscode.replace("^","");
await test(least);

} catch (err) {
console.error('Failed to run tests');
process.exit(1);
Expand Down
Loading

0 comments on commit 643ba09

Please sign in to comment.