Skip to content

Commit 584d492

Browse files
authored
Merge pull request #480 from github0null/dev
v3.26.1 revision
2 parents b74bf67 + 01559be commit 584d492

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ All notable version changes will be recorded in this file.
66

77
***
88

9+
### [v3.26.1] revision
10+
11+
**Fix**:
12+
- `Project Toolchain`: Revert commit 'support generic gcc for arm or riscv projects.'
13+
- `Project Migration`: Fix user context data not migrated. [issues 479](https://github.com/github0null/eide/issues/479)
14+
15+
***
16+
917
### [v3.26.0] update
1018

1119
**Change**:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"homepage": "https://em-ide.com",
3737
"license": "MIT",
3838
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/MIPS/RISC-V",
39-
"version": "3.26.0",
39+
"version": "3.26.1",
4040
"preview": false,
4141
"engines": {
4242
"vscode": "^1.67.0"

src/EIDEProjectMigration.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { EIDE_CONF_VERSION, ProjectConfiguration } from "./EIDETypeDefine";
66
import { compareVersion } from "./utility";
77
import { view_str$prompt$migrationFailed } from "./StringTable";
88
import { GlobalEvent } from "./GlobalEvents";
9+
import { getGlobalState } from "./Platform";
910

1011
export function detectProject(dir: File): boolean {
1112
if (File.IsExist(NodePath.join(dir.path, '.eide', 'eide.yml')))
@@ -73,8 +74,23 @@ async function _doMigration(projectRootDir: File) {
7374

7475
// rm .eide.usr.ctx.json
7576
const p = NodePath.join(projectRootDir.path, '.eide.usr.ctx.json');
76-
if (File.IsFile(p))
77-
try { fs.unlinkSync(p); } catch (error) {}
77+
if (File.IsFile(p)) {
78+
try {
79+
if (prjCfg.miscInfo && prjCfg.miscInfo.uid) {
80+
const ctx = JSON.parse(fs.readFileSync(p, 'utf8'));
81+
const key = `project.${prjCfg.miscInfo.uid}`;
82+
const val = getGlobalState().get<string>(key);
83+
const saveVal = JSON.stringify(ctx);
84+
if (val !== saveVal)
85+
getGlobalState().update(key, saveVal);
86+
}
87+
fs.unlinkSync(p);
88+
} catch (error) {
89+
const errMsg = `${(<Error>error).name} ${(<Error>error).message}`;
90+
GlobalEvent.log_warn(`Fail to migrate user context '${p}'. msg: ${errMsg}`);
91+
GlobalEvent.log_show();
92+
}
93+
}
7894
}
7995

8096
export async function doMigration(projectRootDir: File) {

src/ToolchainManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ export class ToolchainManager {
180180

181181
private readonly toolchainNames: ToolchainEnums = {
182182
'C51': ['GNU_SDCC_MCS51', 'Keil_C51', 'SDCC', 'IAR_STM8', 'COSMIC_STM8'],
183-
'ARM': ['AC5', 'AC6', 'GCC', 'LLVM_ARM', 'IAR_ARM', 'ANY_GCC'],
184-
'RISC-V': ['RISCV_GCC', 'ANY_GCC'],
183+
'ARM': ['AC5', 'AC6', 'GCC', 'LLVM_ARM', 'IAR_ARM'],
184+
'RISC-V': ['RISCV_GCC'],
185185
'MIPS': ['MTI_GCC'],
186186
'ANY-GCC': ['ANY_GCC']
187187
};

0 commit comments

Comments
 (0)