Skip to content

Commit b6a6231

Browse files
committed
🔇 remove localized hover from cpp-docs
prevent channel show of log
1 parent 580748b commit b6a6231

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ platform-specified extension [xsro.vscode-dosbox][vscode-dosbox]
2121
- fix #32: use a TDConfig when debugging with TD for better experience.
2222
- thanks to [x402][x402]
2323
- (vscode-DOSBox) fix the error of update dosbox config
24+
- 1.0.2: remove localized Hover from [cpp-docs][cpp-docs] since no repo from MicrosoftDocs is available
2425

2526
为了保持简洁,我将与DOS模拟器交互的部分独立为一个新的插件[xsro.vscode-dosbox][vscode-dosbox]
2627

@@ -34,13 +35,15 @@ platform-specified extension [xsro.vscode-dosbox][vscode-dosbox]
3435
- 修复格式化中未完全替换原内容的问题
3536
- 恢复原来版本中的TDConfig
3637
- (vscode-dosbox) 修复注入DOSBox设置会出现的混乱
38+
- 1.0.2: 由于MicrosoftDocs不再提供对仓库[cpp-docs][cpp-docs]的本地化仓库,所以现在只能提供英语
3739

3840
[vscode-dosbox]: https://marketplace.visualstudio.com/items?itemName=xsro.vscode-dosbox "VSCode DOSBox"
3941
[dosbox-x]: https://www.dosbox-x.com "DOSBox-x"
4042
[github-dev]: https://github.dev/dosasm/dos-assembly-codes "open sample code with github.dev"
4143
[vscode-dev]: https://vscode.dev/github/dosasm/dos-assembly-codes "open sample code with vscode.dev"
4244
[x402]: https://github.com/x402
4345
[BillLee-CN]: https://github.com/BillLee-CN
46+
[cpp-docs]: https://github.com/MicrosoftDocs/cpp-docs "MicrosoftDocs/cpp-docs"
4447

4548
## 0.9.0
4649

package.json

Lines changed: 1 addition & 1 deletion
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.1",
6+
"version": "1.0.2",
77
"keywords": [
88
"dosbox",
99
"16位",

src/language/hoverFromCppdoc.ts

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,33 @@ class RESOURCES {
4343

4444
static links = [
4545
'https://raw.githubusercontent.com/MicrosoftDocs/{repo}/{branch}/',
46-
'https://cdn.jsdelivr.net/gh/MicrosoftDocs/{repo}@{branch}/docs/',
46+
'https://gitee.com/dosasm/{repo}/raw/{branch}/',
47+
'https://cdn.jsdelivr.net/gh/MicrosoftDocs/{repo}@{branch}/',
4748
];
4849

49-
static getlinks(id: string, lang: string): string[] {
50+
/**get links from the cpp-docs id
51+
* The Microsoft has removed its localized docs repo from github
52+
* TODO: find a way to get the content of localized docs
53+
* see: https://github.com/MicrosoftDocs/cpp-docs
54+
* @param id
55+
* @param lang
56+
* @returns links for download
57+
*/
58+
static getlinks(id: string, lang: string, prefix = 'docs/assembler/masm/'): string[] {
5059
const links = [...RESOURCES.links];
51-
if (lang === 'zh-cn') {
52-
links.unshift('https://gitee.com/dosasm/cpp-docs.zh-cn/raw/live/');
53-
}
54-
let repoName = 'cpp-docs';
55-
const pre = 'docs/assembler/masm/';
56-
let branchName = 'master';
57-
if (lang && Object.keys(RESOURCES.langMap).includes(lang)) {
58-
repoName += `.${RESOURCES.langMap[lang]}`;
59-
branchName = 'live';
60-
}
61-
return links.map(
60+
61+
// if (lang === 'zh-cn') {
62+
// links = ['https://gitee.com/dosasm/cpp-docs.zh-cn/raw/live/'];
63+
// }
64+
65+
const repoName = 'cpp-docs';
66+
const branchName = 'master';
67+
const downloadables = links.map(
6268
val => val.replace('{repo}', repoName)
63-
.replace('{branch}', branchName) + pre + id + '.md'
69+
.replace('{branch}', branchName) + prefix + id + '.md'
6470
);
71+
72+
return downloadables;
6573
}
6674

6775
static generateFromCppdoc(text: string): CppdocInfoCollection {

src/test/suite/ASM.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const singleFileTestSuite = suite("single file mode test", function () {
7373
this.slow('20s');
7474
for (const emu of emulator) {
7575
suite(`test in ${emu}`, async function () {
76-
this.beforeAll(async function () {
76+
this.beforeEach(async function () {
7777
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
7878
});
7979
for (const [file, shouldErr] of [filelist[0], filelist[1]]) {
@@ -91,7 +91,7 @@ export const workspaceTestSuite = suite("workspace mode test", function () {
9191
this.slow('20s');
9292
for (const emu of emulator) {
9393
suite(`test in ${emu}`, async function () {
94-
this.beforeAll(async function () {
94+
this.beforeEach(async function () {
9595
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
9696
});
9797
for (const [file, shouldErr] of [filelist[0], filelist[2]]) {
@@ -108,7 +108,7 @@ if (process.platform === 'win32') {
108108
const emu = DosEmulatorType.msdos;
109109
suite(`test in ${emu}`, async function () {
110110
this.timeout("60s");
111-
this.beforeAll(async function () {
111+
this.beforeEach(async function () {
112112
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
113113
});
114114
for (const asm of [profileId[0]]) {

src/utils/downloadFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function downloadFromMultiSources(urls: string[]): Promise<string |
1313
return val;
1414
}
1515
} catch (e) {
16-
logger.channel(JSON.stringify(e)).show();
16+
logger.channel(`donwload ${url}\nerror ${JSON.stringify(e)}`);
1717
}
1818
}
1919
}

0 commit comments

Comments
 (0)