Skip to content

Commit bb49fe8

Browse files
authored
Merge pull request #406 from github0null/dev
v3.21.1 revision
2 parents 97e32f4 + c31c327 commit bb49fe8

20 files changed

+488
-99
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ All notable version changes will be recorded in this file.
66

77
***
88

9+
### [v3.21.1] revision
10+
11+
**New**:
12+
- `Map View`: Support show `map.view` file for SDCC and KEIL_C51 toolchain.
13+
- `Scatter File Highlight`: Support a simple arm scatter file (`.sct`) language support.
14+
15+
**Fix**:
16+
- `Program Matcher`: Sometimes armcc problem matcher missed matchs.
17+
- `CMSIS Config Wizard`: Missed skip value for `<e>` tag.
18+
19+
***
20+
921
### [v3.21.0] update
1022

1123
**New**:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"comments": {
3+
"lineComment": ";",
4+
"blockComment": ["/*", "*/"],
5+
},
6+
"brackets": [
7+
["{", "}"],
8+
["[", "]"],
9+
["(", ")"]
10+
],
11+
"autoClosingPairs": [
12+
{ "open": "{", "close": "}" },
13+
{ "open": "[", "close": "]" },
14+
{ "open": "(", "close": ")" },
15+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
16+
{ "open": "\"", "close": "\"", "notIn": ["string"] },
17+
{ "open": "/**", "close": " */", "notIn": ["string"] }
18+
],
19+
"indentationRules": {
20+
"increaseIndentPattern": "^\\s*{",
21+
"decreaseIndentPattern": "^\\s*}"
22+
}
23+
}

lang/syntax/sct.tmLanguage.json

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"information_for_contributors": [
3+
"arm scatter file"
4+
],
5+
"version": "1.0.0",
6+
"name": "sct",
7+
"scopeName": "source.arm.sct",
8+
"patterns": [
9+
{
10+
"include": "#commandline"
11+
},
12+
{
13+
"include": "#line_comment"
14+
},
15+
{
16+
"include": "#block_comment"
17+
},
18+
{
19+
"include": "#string"
20+
},
21+
{
22+
"include": "#number"
23+
},
24+
{
25+
"include": "#operators"
26+
},
27+
{
28+
"include": "#preprocessor"
29+
},
30+
{
31+
"include": "#keyword.load_region"
32+
},
33+
{
34+
"include": "#keyword.exec_region"
35+
}
36+
],
37+
"repository": {
38+
"commandline": {
39+
"match": "^#!.*$",
40+
"captures": {
41+
"0": {
42+
"name": "markup.italic"
43+
}
44+
}
45+
},
46+
"line_comment": {
47+
"match": "(;|\\/\\/).*",
48+
"captures": {
49+
"0": {
50+
"name": "comment.line"
51+
}
52+
}
53+
},
54+
"block_comment": {
55+
"begin": "\\/\\*",
56+
"end" : "\\*\\/",
57+
"name": "comment.block"
58+
},
59+
"string": {
60+
"match": "\"([^\"\\\\]*(\\\\.[^\"\\\\]*)*)\"",
61+
"captures": {
62+
"0": {
63+
"name": "string.quoted.double"
64+
}
65+
}
66+
},
67+
"number": {
68+
"match": "(?i)\\b([0-9]+|0x[0-9a-f]+)\\b",
69+
"captures": {
70+
"1": {
71+
"name": "constant.numeric"
72+
}
73+
}
74+
},
75+
"operators": {
76+
"match": "\\+|-|\\*|\\/(?!\\/)|\\+=|-=|=|==|<=|>=|!=",
77+
"captures": {
78+
"0": {
79+
"name": "keyword.operator"
80+
}
81+
}
82+
},
83+
"preprocessor": {
84+
"match": "^\\s*(#define|#undef|#include|#if|#ifdef|#ifndef|#elif|#else|#endif)",
85+
"captures": {
86+
"1": {
87+
"name": "keyword.control.define"
88+
}
89+
}
90+
},
91+
"keyword.load_region": {
92+
"match": "\\b(ABSOLUTE|ALIGN|NOCOMPRESS|OVERLAY|PI|PROTECTED|RELOC)\\b",
93+
"captures": {
94+
"1": {
95+
"name": "keyword"
96+
}
97+
}
98+
},
99+
"keyword.exec_region": {
100+
"match": "\\b(ABSOLUTE|ALIGN|NOCOMPRESS|OVERLAY|PI|ALIGNALL|ANY_SIZE|EMPTY|FILL|FIXED|PADVALUE|SORTTYPE|UNINIT|ZEROPAD)\\b",
101+
"captures": {
102+
"1": {
103+
"name": "keyword"
104+
}
105+
}
106+
}
107+
}
108+
}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+19-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"homepage": "https://em-ide.com",
3939
"license": "MIT",
4040
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/MIPS/RISC-V",
41-
"version": "3.21.0",
41+
"version": "3.21.1",
4242
"preview": false,
4343
"engines": {
4444
"vscode": "^1.67.0"
@@ -1748,6 +1748,19 @@
17481748
"**/*.lkf"
17491749
],
17501750
"configuration": "./lang/syntax/lkf.language-configuration.json"
1751+
},
1752+
{
1753+
"id": "sct",
1754+
"aliases": [
1755+
"ARM Scatter File"
1756+
],
1757+
"extensions": [
1758+
".sct"
1759+
],
1760+
"filenamePatterns": [
1761+
"**/*.sct"
1762+
],
1763+
"configuration": "./lang/syntax/sct.language-configuration.json"
17511764
}
17521765
],
17531766
"jsonValidation": [
@@ -1829,6 +1842,11 @@
18291842
"language": "lkf",
18301843
"scopeName": "source.cosmic.lkf",
18311844
"path": "./lang/syntax/lkf.tmLanguage.json"
1845+
},
1846+
{
1847+
"language": "sct",
1848+
"scopeName": "source.arm.sct",
1849+
"path": "./lang/syntax/sct.tmLanguage.json"
18321850
}
18331851
],
18341852
"taskDefinitions": [

res/tools/darwin/unify_builder/arm64/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/osx-arm64": {
10-
"unify_builder/3.9.1": {
10+
"unify_builder/3.9.2": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.9.1": {
63+
"unify_builder/3.9.2": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""
Binary file not shown.

res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/osx-x64": {
10-
"unify_builder/3.9.1": {
10+
"unify_builder/3.9.2": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.9.1": {
63+
"unify_builder/3.9.2": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""
Binary file not shown.

res/tools/linux/unify_builder/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/linux-x64": {
10-
"unify_builder/3.9.1": {
10+
"unify_builder/3.9.2": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.9.1": {
63+
"unify_builder/3.9.2": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""
0 Bytes
Binary file not shown.

res/tools/win32/unify_builder/unify_builder.deps.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v6.0": {},
99
".NETCoreApp,Version=v6.0/win-x64": {
10-
"unify_builder/3.9.1": {
10+
"unify_builder/3.9.2": {
1111
"dependencies": {
1212
"CommandLineParser": "2.9.1",
1313
"ConsoleTableExt": "3.1.9",
@@ -60,7 +60,7 @@
6060
}
6161
},
6262
"libraries": {
63-
"unify_builder/3.9.1": {
63+
"unify_builder/3.9.2": {
6464
"type": "project",
6565
"serviceable": false,
6666
"sha512": ""
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

src/CmsisConfigParser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ interface ParserContext {
401401

402402
const fieldMatcher: TagMatcher = {
403403
'group': { start: /^\/\/\s*<h>\s*(?<name>.+)/, end: /^\/\/\s*<\/h>/ },
404-
'section': { start: /^\/\/\s*<e(?:\.(?<var_mod_bit_s>[\d]+))?(?: (?<var_name>\w+))?>\s*(?<name>.+?)(?<desc>(?:\s+[-]+\s*.*)?)$/, end: /^\/\/\s*<\/e>/ },
404+
'section': { start: /^\/\/\s*<e(?<var_skip_val>\d+)?(?:\.(?<var_mod_bit_s>[\d]+))?(?: (?<var_name>\w+))?>\s*(?<name>.+?)(?<desc>(?:\s+[-]+\s*.*)?)$/, end: /^\/\/\s*<\/e>/ },
405405
'tooltip': { start: /^\/\/\s*<i>\s*(?<detail>.+)\s*$/ },
406406
'defval': { start: /^\/\/\s*<d>\s*(?<var_def_val>.+)\s*$/ },
407407
'code': { start: /^\/\/\s*<!?c(?<var_skip_val>\d+)?>\s*(?<name>.+?)(?<desc>(?:\s+[-]+\s*.*)?)$/, end: /^\/\/\s*<\/[!]?c>/ },

src/CodeBuilder.ts

+2-47
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export abstract class CodeBuilder {
128128
this._event.emit(event, arg);
129129
}
130130

131-
protected genSourceInfo(prevBuilderParams: BuilderParams | undefined): {
131+
protected genSourceInfo(): {
132132
sources: string[],
133133
params?: { [name: string]: string; }
134134
} {
@@ -175,18 +175,6 @@ export abstract class CodeBuilder {
175175
const parttenInfo = options?.files;
176176
matcher(parttenInfo, 'path');
177177
}
178-
179-
// if src options is modified to null but old is not null,
180-
// we need make source recompile
181-
if (prevBuilderParams) {
182-
const oldSrcParams = prevBuilderParams.sourceParams;
183-
for (const path in oldSrcParams) {
184-
if (srcParams[path] == undefined && oldSrcParams[path] != undefined &&
185-
oldSrcParams[path] != '') {
186-
srcParams[path] = ""; // make it empty to trigger recompile
187-
}
188-
}
189-
}
190178
}
191179

192180
} catch (err) {
@@ -375,9 +363,7 @@ export abstract class CodeBuilder {
375363
const paramsPath = this.project.ToAbsolutePath(outDir + File.sep + this.paramsFileName);
376364
const compileOptions: BuilderOptions = this.project.GetConfiguration().compileConfigModel.getOptions();
377365
const memMaxSize = this.getMcuMemorySize();
378-
const oldParamsPath = `${paramsPath}.old`;
379-
const prevParams: BuilderParams | undefined = File.IsFile(oldParamsPath) ? JSON.parse(fs.readFileSync(oldParamsPath, 'utf8')) : undefined;
380-
const sourceInfo = this.genSourceInfo(prevParams);
366+
const sourceInfo = this.genSourceInfo();
381367
const builderModeList: string[] = []; // build mode
382368

383369
const builderOptions: BuilderParams = {
@@ -497,37 +483,6 @@ export abstract class CodeBuilder {
497483

498484
// set build mode
499485
{
500-
/** --------------------------------------------------------------
501-
* @note After unify_builder v3.9.0, this function is deprecated
502-
* because we have built-in it in the latest unify_builder
503-
* ---------------------------------------------------------------
504-
*/
505-
// // generate hash for compiler options
506-
// builderOptions.sha = this.genHashFromCompilerOptions(builderOptions);
507-
// // check whether need rebuild project
508-
// if (this.isRebuild() == false && prevParams) {
509-
// try {
510-
// // not found hash from old params file
511-
// if (prevParams.sha == undefined) {
512-
// this.enableRebuild();
513-
// }
514-
515-
// // check hash obj by specifies keys
516-
// else {
517-
// const keyList = ['global', 'c/cpp-defines', 'c/cpp-compiler', 'asm-compiler'];
518-
// for (const key of keyList) {
519-
// if (!this.compareHashObj(key, prevParams.sha, builderOptions.sha)) {
520-
// this.enableRebuild();
521-
// break;
522-
// }
523-
// }
524-
// }
525-
// } catch (error) {
526-
// this.enableRebuild(); // make rebuild
527-
// GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
528-
// }
529-
// }
530-
531486
if (config.toolchain === 'Keil_C51') {
532487
builderModeList.push('normal'); // disable increment build for Keil C51
533488
} else {

src/EIDEProject.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -2877,12 +2877,20 @@ $(OUT_DIR):
28772877
}
28782878
}
28792879
} catch (error) {
2880+
GlobalEvent.log_warn(<Error>error);
28802881
const msg = [
28812882
`${toolchain.getToolchainPrefix()}gcc not avaliable:\n${(<Error>error).message}`,
28822883
`Please check your package.json and run 'xpm install' to install xpack dependences.`
28832884
].join(os.EOL);
2884-
GlobalEvent.emit('msg', newMessage('Error', msg));
2885-
GlobalEvent.log_warn(<Error>error);
2885+
vscode.window.showErrorMessage(msg, 'Install', 'Later')
2886+
.then((value) => {
2887+
if (value == 'Install') {
2888+
runShellCommand('xpm install', 'xpm install', {
2889+
useTerminal: true,
2890+
cwd: this.getRootDir().path
2891+
});
2892+
}
2893+
});
28862894
return false
28872895
}
28882896
}

0 commit comments

Comments
 (0)