Skip to content

Commit 30ad532

Browse files
authored
Merge pull request #78 from github0null/dev
v2.15.1 revision
2 parents f642a35 + 305e168 commit 30ad532

11 files changed

Lines changed: 674 additions & 286 deletions

CHANGELOG.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
***
66

7+
### [v2.15.1]
8+
- 新增:支持在**源文件路径****烧录选项->程序文件** 中使用**变量**. 暂支持以下变量:
9+
- `OutDir`: 输出目录
10+
- `ProjectName`: 项目名
11+
- `ExecutableName`: 输出的可执行文件路径,不含后缀
12+
- `ProjectRoot`: 项目根目录
13+
- `项目设置->环境变量` 中的变量(变量名必须只包含字母,数字或下划线)
14+
- 修复:状态栏 **打开串口命令失效**
15+
- 修复:sdcc 错误输出高亮匹配失效
16+
- 优化:使用编辑器右键菜单打开反汇编时,自动根据源文件的当前被选中的 `` 或者 `标识符`,跳转至相应的反汇编行(没有找到则跳转至开头)
17+
- 优化:当源文件不在当前工作区时,向 C/C++ 插件提供源文件的搜索目录
18+
- 优化:打开文件选取对话框时,设置初始路径为项目根目录
19+
- 优化:在使用 Importer 导入多 Target 项目时,使用 \<prjName>+\<targetName> 作为 id,区分列表项
20+
- 优化:优化下载 eide-binaries 时的站点选择
21+
- 优化:若某些烧录器不支持 `Erase Chip`,则忽略该命令
22+
***
23+
724
### [v2.15.0] (**requirements: VsCode ^1.60.0**)
825
- 新增:向**项目属性**视图增加一个**修改**按钮,允许以直接修改 yaml 配置文件的形式修改其配置,[文档](https://docs.em-ide.com/#/zh-cn/project_deps)
926
- 新增:向**项目资源**视图增加一个配置按钮,允许**为单个的文件或组增加任意编译选项**,支持使用 glob 模式匹配源文件和组,[文档](https://docs.em-ide.com/#/zh-cn/project_manager?id=为源文件附加单独的编译选项)
@@ -28,9 +45,9 @@
2845
- 优化:项目资源文件夹树排序显示
2946
- 优化:读取完 JLink Device 列表后,删除临时文件
3047
- 优化:调整构建工具的 Log 显示
31-
- 优化 CMSIS Wizard UI:使被禁用的子项表单控件无法被选中
32-
- 优化 CMSIS Wizard UI:调整布局,优化 vscode 主题颜色适配
33-
- 优化 完善 CMSIS Wizard 的语法支持程度
48+
- 优化CMSIS Wizard UI:使被禁用的子项表单控件无法被选中
49+
- 优化CMSIS Wizard UI:调整布局,优化 vscode 主题颜色适配
50+
- 优化完善 CMSIS Wizard 的语法支持程度
3451
***
3552

3653
### [v2.14.0]

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
],
2727
"homepage": "https://github.com/github0null/eide/blob/master/README.md",
2828
"license": "MIT",
29-
"description": "A singlechip development environment for 8051/STM8/Cortex-M/RISC-V",
30-
"version": "2.15.0",
29+
"description": "An embedded development environment for 8051/STM8/Cortex-M/RISC-V",
30+
"version": "2.15.1",
3131
"engines": {
3232
"vscode": "^1.60.0"
3333
},
@@ -79,6 +79,7 @@
7979
"jsonc": "^2.0.0",
8080
"micromatch": "^4.0.4",
8181
"unzipper": "^0.10.11",
82+
"vscode-cpptools": "^5.0.0",
8283
"x2js": "3.4.1",
8384
"yaml": "^1.10.2"
8485
},

res/data/template.files.options.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
#########################################################################################
2-
# append compiler options for files or virtual folders
3-
#########################################################################################
4-
5-
version: '1.0'
6-
7-
#########################################################################################
8-
# rules
1+
##########################################################################################
2+
# Append Compiler Options For Source Files
93
#
104
# syntax:
115
# <your matcher expr>: <your compiler command>
@@ -19,7 +13,9 @@ version: '1.0'
1913
#
2014
# For more syntax, please refer to: https://www.npmjs.com/package/micromatch
2115
#
22-
#########################################################################################
16+
##########################################################################################
17+
18+
version: '1.0'
2319

2420
#
2521
# for source files with filesystem paths

src/CodeBuilder.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export abstract class CodeBuilder {
105105
this._event.emit(event, arg);
106106
}
107107

108-
genSourceInfo(prevBuilderParams: BuilderParams): {
108+
genSourceInfo(prevBuilderParams: BuilderParams | undefined): {
109109
sources: string[],
110110
params?: { [name: string]: string; }
111111
paramsModTime?: number;
@@ -140,8 +140,10 @@ export abstract class CodeBuilder {
140140
srcList.forEach((srcInf: any) => {
141141
if (!srcInf[fieldName]) return; // skip if not exist
142142
for (const expr in parttenInfo) {
143-
const path = (<string>srcInf[fieldName]).replace(/\\/g, '/');
144-
if (globmatch.isMatch(path, expr)) {
143+
const searchPath = (<string>srcInf[fieldName]).replace(/\\/g, '/')
144+
.replace(/\.\.\//g, '')
145+
.replace(/\.\//g, ''); // globmatch bug ? it can't parse path which have '.' or '..'
146+
if (globmatch.isMatch(searchPath, expr)) {
145147
const val = parttenInfo[expr]?.trim().replace(/(?:\r\n|\n)$/, '')
146148
if (srcParams[srcInf.path]) {
147149
srcParams[srcInf.path] += ` ${val || ''}`
@@ -169,11 +171,13 @@ export abstract class CodeBuilder {
169171

170172
// if src options is modified to null but old is not null,
171173
// we need make source recompile
172-
const oldSrcParams = prevBuilderParams.sourceParams;
173-
for (const path in oldSrcParams) {
174-
if (srcParams[path] == undefined && oldSrcParams[path] != undefined &&
175-
oldSrcParams[path] != '') {
176-
srcParams[path] = ""; // make it empty to trigger recompile
174+
if (prevBuilderParams) {
175+
const oldSrcParams = prevBuilderParams.sourceParams;
176+
for (const path in oldSrcParams) {
177+
if (srcParams[path] == undefined && oldSrcParams[path] != undefined &&
178+
oldSrcParams[path] != '') {
179+
srcParams[path] = ""; // make it empty to trigger recompile
180+
}
177181
}
178182
}
179183
}
@@ -349,7 +353,7 @@ export abstract class CodeBuilder {
349353
const memMaxSize = this.getMaxSize();
350354
const modeList: string[] = [];
351355
const oldParamsPath = `${paramsPath}.old`;
352-
const prevParams: BuilderParams = File.IsFile(oldParamsPath) ? JSON.parse(fs.readFileSync(oldParamsPath, 'utf8')) : {};
356+
const prevParams: BuilderParams | undefined = File.IsFile(oldParamsPath) ? JSON.parse(fs.readFileSync(oldParamsPath, 'utf8')) : undefined;
353357
const sourceInfo = this.genSourceInfo(prevParams);
354358

355359
const builderOptions: BuilderParams = {
@@ -402,7 +406,7 @@ export abstract class CodeBuilder {
402406
builderOptions.sha = this.genHashFromCompilerOptions(builderOptions);
403407

404408
// check whether need rebuild project
405-
if (this.isRebuild() == false) {
409+
if (this.isRebuild() == false && prevParams) {
406410
try {
407411
// not found hash from old params file
408412
if (prevParams.sha == undefined) {

0 commit comments

Comments
 (0)