Skip to content

Commit

Permalink
Merge pull request #139 from github0null/dev
Browse files Browse the repository at this point in the history
v3.7.2 update
  • Loading branch information
github0null authored Jun 14, 2022
2 parents de61ecb + 847f99a commit 4f91c5b
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bin/builder/*.xml
bin/builder/*.exe.config
bin/tools/*
bin_bk
dotnet-runtime*.exe

# shell script
*.sh
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@

***

### [v3.7.2]

**New**:
- 增加右键菜单项:只生成 `builder.params`, 不触发编译
- 为新建项目增加默认工作区设置:`"C_Cpp.errorSquiggles": "Disabled"`
- 支持 iar-stm8 编译错误匹配(由于无法匹配多行,因此暂时不能匹配问题的描述):
```
"c:\Users\xxxx\xxxxx\xxxxxx\xxxx.c",55 Error[Pe020]:
identifier "xxxx" is undefined
xxxxxx
```
- 对于离线 vsix 安装包,支持直接安装内置的 .NET6 运行时(仅windows)
**Change**:
- 使用 2 空格缩进 'eide.json',便于 `git diff`
- 使用 `dotnet --list-runtimes` 检查运行时
- 未找到 .NET6 运行时时,自动安装默认版本 `.NET6.0.5 runtime`,不再给出提示让用户确认(仅windows)
**Optimize**:
- 将 `Build, Rebuild ...` 等命令加入到右键菜单项中
- 将 `Erase Chip` 命令加入到右键菜单项中,并增加快捷键:`ctrl+alt+e`
- 在安装 cmsis 组件时,自动检查 deps 组件根目录是否已加入项目
- 删除多余的设置项:
```
EIDE.Option.ShowOutputFilesInExplorer
EIDE.Option.ShowSourceReferences
EIDE.Option.PrintRelativePathWhenBuild
EIDE.Builder.GenerateMakefileParameters
```
***
### [v3.7.1]
**Fixed**:
Expand Down
71 changes: 45 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"homepage": "https://github.com/github0null/eide/blob/master/README.md",
"license": "MIT",
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/RISC-V",
"version": "3.7.1",
"version": "3.7.2",
"preview": false,
"engines": {
"vscode": "^1.63.0"
Expand Down Expand Up @@ -180,24 +180,12 @@
"markdownDescription": "%settings.enable.telemetry%",
"default": true
},
"EIDE.Option.ShowOutputFilesInExplorer": {
"type": "boolean",
"scope": "resource",
"markdownDescription": "%settings.option.show.output.files%",
"default": true
},
"EIDE.Option.MapViewParserDepth": {
"type": "integer",
"scope": "resource",
"markdownDescription": "%settings.option.mapView.parser.depth%",
"default": 5
},
"EIDE.Option.ShowSourceReferences": {
"type": "boolean",
"scope": "resource",
"markdownDescription": "%settings.option.show.source.references%",
"default": true
},
"EIDE.Option.DisableEditorContextMenu": {
"type": "boolean",
"scope": "resource",
Expand Down Expand Up @@ -246,12 +234,6 @@
"use single thread mode"
]
},
"EIDE.Builder.GenerateMakefileParameters": {
"type": "boolean",
"scope": "resource",
"markdownDescription": "%settings.builder.gen.makefile.params%",
"default": false
},
"EIDE.Builder.AdditionalCommandLine": {
"type": "string",
"scope": "resource",
Expand All @@ -264,12 +246,6 @@
"markdownDescription": "%settings.option.show.toolbar.in.editer.title%",
"default": true
},
"EIDE.Option.PrintRelativePathWhenBuild": {
"type": "boolean",
"scope": "resource",
"markdownDescription": "%settings.option.print.relative.path%",
"default": true
},
"EIDE.Option.UseTaskToBuild": {
"type": "boolean",
"scope": "resource",
Expand Down Expand Up @@ -516,6 +492,10 @@
}
],
"commands": [
{
"command": "eide.project.genBuilderParams",
"title": "Generate builder.params for project"
},
{
"command": "eide.operation.install_toolchain",
"title": "Install toolchain for eide"
Expand Down Expand Up @@ -993,6 +973,11 @@
}
],
"keybindings": [
{
"command": "eide.project.flash.erase.all",
"key": "ctrl+alt+e",
"when": "cl.eide.projectActived"
},
{
"command": "eide.project.uploadToDevice",
"key": "ctrl+alt+d",
Expand Down Expand Up @@ -1185,16 +1170,32 @@
"command": "_cl.eide.project.exportXml",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.genBuilderParams",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.rebuild",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.rebuild",
"group": "inline",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.build",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.build",
"group": "inline",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.clean",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.clean",
"group": "inline",
Expand All @@ -1208,14 +1209,18 @@
"command": "_cl.eide.project.generate.makefile",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.uploadToDevice",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.uploadToDevice",
"group": "inline",
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "eide.project.flash.erase.all",
"when": "view == Project && viewItem == UPLOAD_OPTION"
"when": "viewItem == SOLUTION && view == Project"
},
{
"command": "_cl.eide.project.close",
Expand Down Expand Up @@ -1539,6 +1544,20 @@
"message": 5
}
]
},
{
"name": "iarstm8",
"fileLocation": "autoDetect",
"pattern": [
{
"regexp": "^\\s*\"([^\"]+)\",(\\d+)\\s+(Error|Warning)\\[(Pe\\w+)\\]: ",
"file": 1,
"line": 2,
"severity": 3,
"code": 4,
"message": 4
}
]
}
]
}
Expand Down
11 changes: 9 additions & 2 deletions src/CodeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export interface BuildOptions {
useDebug?: boolean;

useFastMode?: boolean;

flashAfterBuild?: boolean;

onlyGenParams?: boolean;
}

export interface BuilderParams {
Expand Down Expand Up @@ -306,8 +310,6 @@ export abstract class CodeBuilder {

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

const resManager = ResManager.GetInstance();

// reinit build mode
this.useFastCompile = options?.useFastMode;
this.useShowParamsMode = options?.useDebug;
Expand All @@ -325,6 +327,9 @@ export abstract class CodeBuilder {
this.getCommands()
);

// if only generate params, exit
if (options?.onlyGenParams) return;

return commandLine;
}

Expand Down Expand Up @@ -1017,6 +1022,8 @@ class C51CodeBuilder extends CodeBuilder {
return ['$gcc'];
case 'Keil_C51':
return ['$keilc51'];
case 'IAR_STM8':
return ['$iarstm8'];
default:
return [];
}
Expand Down
13 changes: 12 additions & 1 deletion src/DependenceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export class DependenceManager implements ManagerInterface {

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

// try add dep root to project before install a component
this.tryAddCompRootDirToProject();

const config = this.project.GetConfiguration();
const toolchain = this.project.getToolchain();

Expand Down Expand Up @@ -239,7 +242,7 @@ export class DependenceManager implements ManagerInterface {

getDependenceRootFolder(): File {
if (this.depDir === undefined) {
throw new Error('depDir is undefined');
throw new Error('eide depDir is undefined');
}
return this.depDir;
}
Expand Down Expand Up @@ -318,6 +321,14 @@ export class DependenceManager implements ManagerInterface {

//--

private tryAddCompRootDirToProject() {
const depRoot = this.getDependenceRootFolder();
if (!depRoot.IsDir()) depRoot.CreateDir(false);
const prjConfig = this.project.GetConfiguration();
prjConfig.addSrcDirAtFirst(depRoot.path);
prjConfig.CustomDep_AddIncDir(depRoot);
}

private getDepDir(): File {
this.depDir?.CreateDir(false);
return <File>this.depDir;
Expand Down
20 changes: 9 additions & 11 deletions src/EIDEProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2332,16 +2332,16 @@ class EIDEProject extends AbstractProject {
return new Promise((resolve) => {

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

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

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

Expand All @@ -2351,7 +2351,7 @@ class EIDEProject extends AbstractProject {

} catch (error) {
GlobalEvent.emit('globalLog', ExceptionToMessage(error));
GlobalEvent.emit('eide.log.show');
GlobalEvent.emit('globalLog.show');
}

return false;
Expand Down Expand Up @@ -2394,10 +2394,8 @@ class EIDEProject extends AbstractProject {
settings['C_Cpp.default.configurationProvider'] = this.extensionId;
}

if (this.GetConfiguration().config.type == 'C51') {
if (settings['C_Cpp.errorSquiggles'] === undefined) {
settings['C_Cpp.errorSquiggles'] = "Disabled";
}
if (settings['C_Cpp.errorSquiggles'] === undefined) {
settings['C_Cpp.errorSquiggles'] = "Disabled";
}

// remove some c/c++ configs
Expand Down Expand Up @@ -2611,7 +2609,7 @@ class EIDEProject extends AbstractProject {
if (!done) {
const msg = `Run 'post-install' failed !, please check logs in 'eide-log' output panel.`;
vscode.window.showWarningMessage(msg);
GlobalEvent.emit('eide.log.show');
GlobalEvent.emit('globalLog.show');
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/EIDEProjectExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ export class ProjectExplorer implements CustomConfigurationProvider {
}

private _buildLock: boolean = false;
BuildSolution(prjItem?: ProjTreeItem, options?: BuildOptions, flashAfterBuild?: boolean) {
BuildSolution(prjItem?: ProjTreeItem, options?: BuildOptions) {

const prj = this.getProjectByTreeItem(prjItem);

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

// start build
Expand Down
2 changes: 1 addition & 1 deletion src/EIDETypeDefine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ export class ProjectConfiguration<T extends BuilderConfigData>
}
}

super.Save(undefined);
super.Save(undefined, 2);

// recover it
this.config.srcDirs = oldSrcDirs;
Expand Down
8 changes: 4 additions & 4 deletions src/GlobalEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export class GlobalEvent {
static on(event: 'error', listener: (error: Error) => void): void;
static on(event: 'msg', listener: (msg: Message) => void): void;
static on(event: 'globalLog', listener: (msg: Message) => void): void;
static on(event: 'eide.log.append', listener: (log: string) => void): void;
static on(event: 'eide.log.show', listener: () => void): void;
static on(event: 'globalLog.append', listener: (log: string) => void): void;
static on(event: 'globalLog.show', listener: () => void): void;
static on(event: any, args?: any): void {
GlobalEvent.GetInstance()._emitter.on(event, args);
}
Expand All @@ -82,8 +82,8 @@ export class GlobalEvent {
static emit(event: 'error', error: Error): boolean;
static emit(event: 'msg', msg: Message): boolean;
static emit(event: 'globalLog', msg: Message): boolean;
static emit(event: 'eide.log.append', log: string): boolean;
static emit(event: 'eide.log.show'): boolean;
static emit(event: 'globalLog.append', log: string): boolean;
static emit(event: 'globalLog.show'): boolean;
static emit(event: any, args?: any): boolean {
return GlobalEvent.GetInstance()._emitter.emit(event, args);
}
Expand Down
Loading

0 comments on commit 4f91c5b

Please sign in to comment.