Skip to content

Commit 4f91c5b

Browse files
authored
Merge pull request #139 from github0null/dev
v3.7.2 update
2 parents de61ecb + 847f99a commit 4f91c5b

File tree

11 files changed

+191
-94
lines changed

11 files changed

+191
-94
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bin/builder/*.xml
2626
bin/builder/*.exe.config
2727
bin/tools/*
2828
bin_bk
29+
dotnet-runtime*.exe
2930

3031
# shell script
3132
*.sh

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@
44

55
***
66

7+
### [v3.7.2]
8+
9+
**New**:
10+
- 增加右键菜单项:只生成 `builder.params`, 不触发编译
11+
- 为新建项目增加默认工作区设置:`"C_Cpp.errorSquiggles": "Disabled"`
12+
- 支持 iar-stm8 编译错误匹配(由于无法匹配多行,因此暂时不能匹配问题的描述):
13+
```
14+
"c:\Users\xxxx\xxxxx\xxxxxx\xxxx.c",55 Error[Pe020]:
15+
identifier "xxxx" is undefined
16+
xxxxxx
17+
```
18+
- 对于离线 vsix 安装包,支持直接安装内置的 .NET6 运行时(仅windows)
19+
20+
**Change**:
21+
- 使用 2 空格缩进 'eide.json',便于 `git diff`
22+
- 使用 `dotnet --list-runtimes` 检查运行时
23+
- 未找到 .NET6 运行时时,自动安装默认版本 `.NET6.0.5 runtime`,不再给出提示让用户确认(仅windows)
24+
25+
**Optimize**:
26+
- 将 `Build, Rebuild ...` 等命令加入到右键菜单项中
27+
- 将 `Erase Chip` 命令加入到右键菜单项中,并增加快捷键:`ctrl+alt+e`
28+
- 在安装 cmsis 组件时,自动检查 deps 组件根目录是否已加入项目
29+
- 删除多余的设置项:
30+
```
31+
EIDE.Option.ShowOutputFilesInExplorer
32+
EIDE.Option.ShowSourceReferences
33+
EIDE.Option.PrintRelativePathWhenBuild
34+
EIDE.Builder.GenerateMakefileParameters
35+
```
36+
37+
***
38+
739
### [v3.7.1]
840
941
**Fixed**:

package.json

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"homepage": "https://github.com/github0null/eide/blob/master/README.md",
3333
"license": "MIT",
3434
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/RISC-V",
35-
"version": "3.7.1",
35+
"version": "3.7.2",
3636
"preview": false,
3737
"engines": {
3838
"vscode": "^1.63.0"
@@ -180,24 +180,12 @@
180180
"markdownDescription": "%settings.enable.telemetry%",
181181
"default": true
182182
},
183-
"EIDE.Option.ShowOutputFilesInExplorer": {
184-
"type": "boolean",
185-
"scope": "resource",
186-
"markdownDescription": "%settings.option.show.output.files%",
187-
"default": true
188-
},
189183
"EIDE.Option.MapViewParserDepth": {
190184
"type": "integer",
191185
"scope": "resource",
192186
"markdownDescription": "%settings.option.mapView.parser.depth%",
193187
"default": 5
194188
},
195-
"EIDE.Option.ShowSourceReferences": {
196-
"type": "boolean",
197-
"scope": "resource",
198-
"markdownDescription": "%settings.option.show.source.references%",
199-
"default": true
200-
},
201189
"EIDE.Option.DisableEditorContextMenu": {
202190
"type": "boolean",
203191
"scope": "resource",
@@ -246,12 +234,6 @@
246234
"use single thread mode"
247235
]
248236
},
249-
"EIDE.Builder.GenerateMakefileParameters": {
250-
"type": "boolean",
251-
"scope": "resource",
252-
"markdownDescription": "%settings.builder.gen.makefile.params%",
253-
"default": false
254-
},
255237
"EIDE.Builder.AdditionalCommandLine": {
256238
"type": "string",
257239
"scope": "resource",
@@ -264,12 +246,6 @@
264246
"markdownDescription": "%settings.option.show.toolbar.in.editer.title%",
265247
"default": true
266248
},
267-
"EIDE.Option.PrintRelativePathWhenBuild": {
268-
"type": "boolean",
269-
"scope": "resource",
270-
"markdownDescription": "%settings.option.print.relative.path%",
271-
"default": true
272-
},
273249
"EIDE.Option.UseTaskToBuild": {
274250
"type": "boolean",
275251
"scope": "resource",
@@ -516,6 +492,10 @@
516492
}
517493
],
518494
"commands": [
495+
{
496+
"command": "eide.project.genBuilderParams",
497+
"title": "Generate builder.params for project"
498+
},
519499
{
520500
"command": "eide.operation.install_toolchain",
521501
"title": "Install toolchain for eide"
@@ -993,6 +973,11 @@
993973
}
994974
],
995975
"keybindings": [
976+
{
977+
"command": "eide.project.flash.erase.all",
978+
"key": "ctrl+alt+e",
979+
"when": "cl.eide.projectActived"
980+
},
996981
{
997982
"command": "eide.project.uploadToDevice",
998983
"key": "ctrl+alt+d",
@@ -1185,16 +1170,32 @@
11851170
"command": "_cl.eide.project.exportXml",
11861171
"when": "viewItem == SOLUTION && view == Project"
11871172
},
1173+
{
1174+
"command": "eide.project.genBuilderParams",
1175+
"when": "viewItem == SOLUTION && view == Project"
1176+
},
1177+
{
1178+
"command": "eide.project.rebuild",
1179+
"when": "viewItem == SOLUTION && view == Project"
1180+
},
11881181
{
11891182
"command": "eide.project.rebuild",
11901183
"group": "inline",
11911184
"when": "viewItem == SOLUTION && view == Project"
11921185
},
1186+
{
1187+
"command": "eide.project.build",
1188+
"when": "viewItem == SOLUTION && view == Project"
1189+
},
11931190
{
11941191
"command": "eide.project.build",
11951192
"group": "inline",
11961193
"when": "viewItem == SOLUTION && view == Project"
11971194
},
1195+
{
1196+
"command": "eide.project.clean",
1197+
"when": "viewItem == SOLUTION && view == Project"
1198+
},
11981199
{
11991200
"command": "eide.project.clean",
12001201
"group": "inline",
@@ -1208,14 +1209,18 @@
12081209
"command": "_cl.eide.project.generate.makefile",
12091210
"when": "viewItem == SOLUTION && view == Project"
12101211
},
1212+
{
1213+
"command": "eide.project.uploadToDevice",
1214+
"when": "viewItem == SOLUTION && view == Project"
1215+
},
12111216
{
12121217
"command": "eide.project.uploadToDevice",
12131218
"group": "inline",
12141219
"when": "viewItem == SOLUTION && view == Project"
12151220
},
12161221
{
12171222
"command": "eide.project.flash.erase.all",
1218-
"when": "view == Project && viewItem == UPLOAD_OPTION"
1223+
"when": "viewItem == SOLUTION && view == Project"
12191224
},
12201225
{
12211226
"command": "_cl.eide.project.close",
@@ -1539,6 +1544,20 @@
15391544
"message": 5
15401545
}
15411546
]
1547+
},
1548+
{
1549+
"name": "iarstm8",
1550+
"fileLocation": "autoDetect",
1551+
"pattern": [
1552+
{
1553+
"regexp": "^\\s*\"([^\"]+)\",(\\d+)\\s+(Error|Warning)\\[(Pe\\w+)\\]: ",
1554+
"file": 1,
1555+
"line": 2,
1556+
"severity": 3,
1557+
"code": 4,
1558+
"message": 4
1559+
}
1560+
]
15421561
}
15431562
]
15441563
}

src/CodeBuilder.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export interface BuildOptions {
5656
useDebug?: boolean;
5757

5858
useFastMode?: boolean;
59+
60+
flashAfterBuild?: boolean;
61+
62+
onlyGenParams?: boolean;
5963
}
6064

6165
export interface BuilderParams {
@@ -306,8 +310,6 @@ export abstract class CodeBuilder {
306310

307311
genBuildCommand(options?: BuildOptions, disPowershell?: boolean): string | undefined {
308312

309-
const resManager = ResManager.GetInstance();
310-
311313
// reinit build mode
312314
this.useFastCompile = options?.useFastMode;
313315
this.useShowParamsMode = options?.useDebug;
@@ -325,6 +327,9 @@ export abstract class CodeBuilder {
325327
this.getCommands()
326328
);
327329

330+
// if only generate params, exit
331+
if (options?.onlyGenParams) return;
332+
328333
return commandLine;
329334
}
330335

@@ -1017,6 +1022,8 @@ class C51CodeBuilder extends CodeBuilder {
10171022
return ['$gcc'];
10181023
case 'Keil_C51':
10191024
return ['$keilc51'];
1025+
case 'IAR_STM8':
1026+
return ['$iarstm8'];
10201027
default:
10211028
return [];
10221029
}

src/DependenceManager.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export class DependenceManager implements ManagerInterface {
6868

6969
InstallComponent(packName: string, component: Component, clearDir: boolean = true) {
7070

71+
// try add dep root to project before install a component
72+
this.tryAddCompRootDirToProject();
73+
7174
const config = this.project.GetConfiguration();
7275
const toolchain = this.project.getToolchain();
7376

@@ -239,7 +242,7 @@ export class DependenceManager implements ManagerInterface {
239242

240243
getDependenceRootFolder(): File {
241244
if (this.depDir === undefined) {
242-
throw new Error('depDir is undefined');
245+
throw new Error('eide depDir is undefined');
243246
}
244247
return this.depDir;
245248
}
@@ -318,6 +321,14 @@ export class DependenceManager implements ManagerInterface {
318321

319322
//--
320323

324+
private tryAddCompRootDirToProject() {
325+
const depRoot = this.getDependenceRootFolder();
326+
if (!depRoot.IsDir()) depRoot.CreateDir(false);
327+
const prjConfig = this.project.GetConfiguration();
328+
prjConfig.addSrcDirAtFirst(depRoot.path);
329+
prjConfig.CustomDep_AddIncDir(depRoot);
330+
}
331+
321332
private getDepDir(): File {
322333
this.depDir?.CreateDir(false);
323334
return <File>this.depDir;

src/EIDEProject.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,16 +2332,16 @@ class EIDEProject extends AbstractProject {
23322332
return new Promise((resolve) => {
23332333

23342334
proc.on('launch', () => {
2335-
GlobalEvent.emit('eide.log.append', os.EOL + `>> running '${scriptName}' ...` + os.EOL);
2336-
GlobalEvent.emit('eide.log.show');
2335+
GlobalEvent.emit('globalLog.append', os.EOL + `>> running '${scriptName}' ...` + os.EOL);
2336+
GlobalEvent.emit('globalLog.show');
23372337
});
23382338

2339-
proc.on('line', (line) => GlobalEvent.emit('eide.log.append', line + os.EOL));
2340-
proc.on('errLine', (line) => GlobalEvent.emit('eide.log.append', line + os.EOL));
2339+
proc.on('line', (line) => GlobalEvent.emit('globalLog.append', line + os.EOL));
2340+
proc.on('errLine', (line) => GlobalEvent.emit('globalLog.append', line + os.EOL));
23412341
proc.on('error', (err) => GlobalEvent.emit('globalLog', ExceptionToMessage(err)));
23422342

23432343
proc.on('close', (exitInf) => {
2344-
GlobalEvent.emit('eide.log.append', os.EOL + `process exited, exitCode: ${exitInf.code}` + os.EOL)
2344+
GlobalEvent.emit('globalLog.append', os.EOL + `process exited, exitCode: ${exitInf.code}` + os.EOL)
23452345
resolve(exitInf.code == 0);
23462346
});
23472347

@@ -2351,7 +2351,7 @@ class EIDEProject extends AbstractProject {
23512351

23522352
} catch (error) {
23532353
GlobalEvent.emit('globalLog', ExceptionToMessage(error));
2354-
GlobalEvent.emit('eide.log.show');
2354+
GlobalEvent.emit('globalLog.show');
23552355
}
23562356

23572357
return false;
@@ -2394,10 +2394,8 @@ class EIDEProject extends AbstractProject {
23942394
settings['C_Cpp.default.configurationProvider'] = this.extensionId;
23952395
}
23962396

2397-
if (this.GetConfiguration().config.type == 'C51') {
2398-
if (settings['C_Cpp.errorSquiggles'] === undefined) {
2399-
settings['C_Cpp.errorSquiggles'] = "Disabled";
2400-
}
2397+
if (settings['C_Cpp.errorSquiggles'] === undefined) {
2398+
settings['C_Cpp.errorSquiggles'] = "Disabled";
24012399
}
24022400

24032401
// remove some c/c++ configs
@@ -2611,7 +2609,7 @@ class EIDEProject extends AbstractProject {
26112609
if (!done) {
26122610
const msg = `Run 'post-install' failed !, please check logs in 'eide-log' output panel.`;
26132611
vscode.window.showWarningMessage(msg);
2614-
GlobalEvent.emit('eide.log.show');
2612+
GlobalEvent.emit('globalLog.show');
26152613
}
26162614
});
26172615
}

src/EIDEProjectExplorer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ export class ProjectExplorer implements CustomConfigurationProvider {
23132313
}
23142314

23152315
private _buildLock: boolean = false;
2316-
BuildSolution(prjItem?: ProjTreeItem, options?: BuildOptions, flashAfterBuild?: boolean) {
2316+
BuildSolution(prjItem?: ProjTreeItem, options?: BuildOptions) {
23172317

23182318
const prj = this.getProjectByTreeItem(prjItem);
23192319

@@ -2342,7 +2342,7 @@ export class ProjectExplorer implements CustomConfigurationProvider {
23422342
codeBuilder.on('finished', (done) => {
23432343
prj.notifyUpdateSourceRefs(toolchain);
23442344
this.notifyUpdateOutputFolder(prj);
2345-
if (flashAfterBuild && done) { this.UploadToDevice(prjItem); }
2345+
if (options?.flashAfterBuild && done) this.UploadToDevice(prjItem);
23462346
});
23472347

23482348
// start build

src/EIDETypeDefine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ export class ProjectConfiguration<T extends BuilderConfigData>
12941294
}
12951295
}
12961296

1297-
super.Save(undefined);
1297+
super.Save(undefined, 2);
12981298

12991299
// recover it
13001300
this.config.srcDirs = oldSrcDirs;

src/GlobalEvents.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export class GlobalEvent {
5454
static on(event: 'error', listener: (error: Error) => void): void;
5555
static on(event: 'msg', listener: (msg: Message) => void): void;
5656
static on(event: 'globalLog', listener: (msg: Message) => void): void;
57-
static on(event: 'eide.log.append', listener: (log: string) => void): void;
58-
static on(event: 'eide.log.show', listener: () => void): void;
57+
static on(event: 'globalLog.append', listener: (log: string) => void): void;
58+
static on(event: 'globalLog.show', listener: () => void): void;
5959
static on(event: any, args?: any): void {
6060
GlobalEvent.GetInstance()._emitter.on(event, args);
6161
}
@@ -82,8 +82,8 @@ export class GlobalEvent {
8282
static emit(event: 'error', error: Error): boolean;
8383
static emit(event: 'msg', msg: Message): boolean;
8484
static emit(event: 'globalLog', msg: Message): boolean;
85-
static emit(event: 'eide.log.append', log: string): boolean;
86-
static emit(event: 'eide.log.show'): boolean;
85+
static emit(event: 'globalLog.append', log: string): boolean;
86+
static emit(event: 'globalLog.show'): boolean;
8787
static emit(event: any, args?: any): boolean {
8888
return GlobalEvent.GetInstance()._emitter.emit(event, args);
8989
}

0 commit comments

Comments
 (0)