Skip to content

Commit

Permalink
Merge pull request #406 from github0null/dev
Browse files Browse the repository at this point in the history
v3.21.1 revision
  • Loading branch information
github0null authored Jan 19, 2025
2 parents 97e32f4 + c31c327 commit bb49fe8
Show file tree
Hide file tree
Showing 20 changed files with 488 additions and 99 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ All notable version changes will be recorded in this file.

***

### [v3.21.1] revision

**New**:
- `Map View`: Support show `map.view` file for SDCC and KEIL_C51 toolchain.
- `Scatter File Highlight`: Support a simple arm scatter file (`.sct`) language support.

**Fix**:
- `Program Matcher`: Sometimes armcc problem matcher missed matchs.
- `CMSIS Config Wizard`: Missed skip value for `<e>` tag.

***

### [v3.21.0] update

**New**:
Expand Down
23 changes: 23 additions & 0 deletions lang/syntax/sct.language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"comments": {
"lineComment": ";",
"blockComment": ["/*", "*/"],
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "/**", "close": " */", "notIn": ["string"] }
],
"indentationRules": {
"increaseIndentPattern": "^\\s*{",
"decreaseIndentPattern": "^\\s*}"
}
}
108 changes: 108 additions & 0 deletions lang/syntax/sct.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"information_for_contributors": [
"arm scatter file"
],
"version": "1.0.0",
"name": "sct",
"scopeName": "source.arm.sct",
"patterns": [
{
"include": "#commandline"
},
{
"include": "#line_comment"
},
{
"include": "#block_comment"
},
{
"include": "#string"
},
{
"include": "#number"
},
{
"include": "#operators"
},
{
"include": "#preprocessor"
},
{
"include": "#keyword.load_region"
},
{
"include": "#keyword.exec_region"
}
],
"repository": {
"commandline": {
"match": "^#!.*$",
"captures": {
"0": {
"name": "markup.italic"
}
}
},
"line_comment": {
"match": "(;|\\/\\/).*",
"captures": {
"0": {
"name": "comment.line"
}
}
},
"block_comment": {
"begin": "\\/\\*",
"end" : "\\*\\/",
"name": "comment.block"
},
"string": {
"match": "\"([^\"\\\\]*(\\\\.[^\"\\\\]*)*)\"",
"captures": {
"0": {
"name": "string.quoted.double"
}
}
},
"number": {
"match": "(?i)\\b([0-9]+|0x[0-9a-f]+)\\b",
"captures": {
"1": {
"name": "constant.numeric"
}
}
},
"operators": {
"match": "\\+|-|\\*|\\/(?!\\/)|\\+=|-=|=|==|<=|>=|!=",
"captures": {
"0": {
"name": "keyword.operator"
}
}
},
"preprocessor": {
"match": "^\\s*(#define|#undef|#include|#if|#ifdef|#ifndef|#elif|#else|#endif)",
"captures": {
"1": {
"name": "keyword.control.define"
}
}
},
"keyword.load_region": {
"match": "\\b(ABSOLUTE|ALIGN|NOCOMPRESS|OVERLAY|PI|PROTECTED|RELOC)\\b",
"captures": {
"1": {
"name": "keyword"
}
}
},
"keyword.exec_region": {
"match": "\\b(ABSOLUTE|ALIGN|NOCOMPRESS|OVERLAY|PI|ALIGNALL|ANY_SIZE|EMPTY|FILL|FIXED|PADVALUE|SORTTYPE|UNINIT|ZEROPAD)\\b",
"captures": {
"1": {
"name": "keyword"
}
}
}
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"homepage": "https://em-ide.com",
"license": "MIT",
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/MIPS/RISC-V",
"version": "3.21.0",
"version": "3.21.1",
"preview": false,
"engines": {
"vscode": "^1.67.0"
Expand Down Expand Up @@ -1748,6 +1748,19 @@
"**/*.lkf"
],
"configuration": "./lang/syntax/lkf.language-configuration.json"
},
{
"id": "sct",
"aliases": [
"ARM Scatter File"
],
"extensions": [
".sct"
],
"filenamePatterns": [
"**/*.sct"
],
"configuration": "./lang/syntax/sct.language-configuration.json"
}
],
"jsonValidation": [
Expand Down Expand Up @@ -1829,6 +1842,11 @@
"language": "lkf",
"scopeName": "source.cosmic.lkf",
"path": "./lang/syntax/lkf.tmLanguage.json"
},
{
"language": "sct",
"scopeName": "source.arm.sct",
"path": "./lang/syntax/sct.tmLanguage.json"
}
],
"taskDefinitions": [
Expand Down
4 changes: 2 additions & 2 deletions res/tools/darwin/unify_builder/arm64/unify_builder.deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"targets": {
".NETCoreApp,Version=v6.0": {},
".NETCoreApp,Version=v6.0/osx-arm64": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"dependencies": {
"CommandLineParser": "2.9.1",
"ConsoleTableExt": "3.1.9",
Expand Down Expand Up @@ -60,7 +60,7 @@
}
},
"libraries": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified res/tools/darwin/unify_builder/arm64/unify_builder.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"targets": {
".NETCoreApp,Version=v6.0": {},
".NETCoreApp,Version=v6.0/osx-x64": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"dependencies": {
"CommandLineParser": "2.9.1",
"ConsoleTableExt": "3.1.9",
Expand Down Expand Up @@ -60,7 +60,7 @@
}
},
"libraries": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified res/tools/darwin/unify_builder/x86_64/unify_builder.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions res/tools/linux/unify_builder/unify_builder.deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"targets": {
".NETCoreApp,Version=v6.0": {},
".NETCoreApp,Version=v6.0/linux-x64": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"dependencies": {
"CommandLineParser": "2.9.1",
"ConsoleTableExt": "3.1.9",
Expand Down Expand Up @@ -60,7 +60,7 @@
}
},
"libraries": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified res/tools/linux/unify_builder/unify_builder.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions res/tools/win32/unify_builder/unify_builder.deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"targets": {
".NETCoreApp,Version=v6.0": {},
".NETCoreApp,Version=v6.0/win-x64": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"dependencies": {
"CommandLineParser": "2.9.1",
"ConsoleTableExt": "3.1.9",
Expand Down Expand Up @@ -60,7 +60,7 @@
}
},
"libraries": {
"unify_builder/3.9.1": {
"unify_builder/3.9.2": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file modified res/tools/win32/unify_builder/unify_builder.dll
Binary file not shown.
Binary file modified res/tools/win32/unify_builder/unify_builder.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/CmsisConfigParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ interface ParserContext {

const fieldMatcher: TagMatcher = {
'group': { start: /^\/\/\s*<h>\s*(?<name>.+)/, end: /^\/\/\s*<\/h>/ },
'section': { start: /^\/\/\s*<e(?:\.(?<var_mod_bit_s>[\d]+))?(?: (?<var_name>\w+))?>\s*(?<name>.+?)(?<desc>(?:\s+[-]+\s*.*)?)$/, end: /^\/\/\s*<\/e>/ },
'section': { start: /^\/\/\s*<e(?<var_skip_val>\d+)?(?:\.(?<var_mod_bit_s>[\d]+))?(?: (?<var_name>\w+))?>\s*(?<name>.+?)(?<desc>(?:\s+[-]+\s*.*)?)$/, end: /^\/\/\s*<\/e>/ },
'tooltip': { start: /^\/\/\s*<i>\s*(?<detail>.+)\s*$/ },
'defval': { start: /^\/\/\s*<d>\s*(?<var_def_val>.+)\s*$/ },
'code': { start: /^\/\/\s*<!?c(?<var_skip_val>\d+)?>\s*(?<name>.+?)(?<desc>(?:\s+[-]+\s*.*)?)$/, end: /^\/\/\s*<\/[!]?c>/ },
Expand Down
49 changes: 2 additions & 47 deletions src/CodeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export abstract class CodeBuilder {
this._event.emit(event, arg);
}

protected genSourceInfo(prevBuilderParams: BuilderParams | undefined): {
protected genSourceInfo(): {
sources: string[],
params?: { [name: string]: string; }
} {
Expand Down Expand Up @@ -175,18 +175,6 @@ export abstract class CodeBuilder {
const parttenInfo = options?.files;
matcher(parttenInfo, 'path');
}

// if src options is modified to null but old is not null,
// we need make source recompile
if (prevBuilderParams) {
const oldSrcParams = prevBuilderParams.sourceParams;
for (const path in oldSrcParams) {
if (srcParams[path] == undefined && oldSrcParams[path] != undefined &&
oldSrcParams[path] != '') {
srcParams[path] = ""; // make it empty to trigger recompile
}
}
}
}

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

const builderOptions: BuilderParams = {
Expand Down Expand Up @@ -497,37 +483,6 @@ export abstract class CodeBuilder {

// set build mode
{
/** --------------------------------------------------------------
* @note After unify_builder v3.9.0, this function is deprecated
* because we have built-in it in the latest unify_builder
* ---------------------------------------------------------------
*/
// // generate hash for compiler options
// builderOptions.sha = this.genHashFromCompilerOptions(builderOptions);
// // check whether need rebuild project
// if (this.isRebuild() == false && prevParams) {
// try {
// // not found hash from old params file
// if (prevParams.sha == undefined) {
// this.enableRebuild();
// }

// // check hash obj by specifies keys
// else {
// const keyList = ['global', 'c/cpp-defines', 'c/cpp-compiler', 'asm-compiler'];
// for (const key of keyList) {
// if (!this.compareHashObj(key, prevParams.sha, builderOptions.sha)) {
// this.enableRebuild();
// break;
// }
// }
// }
// } catch (error) {
// this.enableRebuild(); // make rebuild
// GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
// }
// }

if (config.toolchain === 'Keil_C51') {
builderModeList.push('normal'); // disable increment build for Keil C51
} else {
Expand Down
12 changes: 10 additions & 2 deletions src/EIDEProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2877,12 +2877,20 @@ $(OUT_DIR):
}
}
} catch (error) {
GlobalEvent.log_warn(<Error>error);
const msg = [
`${toolchain.getToolchainPrefix()}gcc not avaliable:\n${(<Error>error).message}`,
`Please check your package.json and run 'xpm install' to install xpack dependences.`
].join(os.EOL);
GlobalEvent.emit('msg', newMessage('Error', msg));
GlobalEvent.log_warn(<Error>error);
vscode.window.showErrorMessage(msg, 'Install', 'Later')
.then((value) => {
if (value == 'Install') {
runShellCommand('xpm install', 'xpm install', {
useTerminal: true,
cwd: this.getRootDir().path
});
}
});
return false
}
}
Expand Down
Loading

0 comments on commit bb49fe8

Please sign in to comment.