Skip to content

Commit

Permalink
fixed: Build log are garbled
Browse files Browse the repository at this point in the history
  • Loading branch information
lordlezehaf committed Nov 2, 2023
1 parent 3797969 commit 119a27f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to the "keil-assistant" extension will be documented in this file.

## [v1.8.7]
- Fixed:
- Build log are garbled
***

## [v1.8.6]
- Fixed:
- Keil log out show
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "keil-vscode-assistant",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.8.6",
"version": "1.8.7",
"publisher": "jacksonjim",
"icon": "res/icons/icon.png",
"author": "jacksonjim <[email protected]>",
Expand Down
12 changes: 8 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,16 @@ abstract class Target implements IView {
const fd = openSync(this.uv4LogFile.path, 'r');
const watcher = workspace.createFileSystemWatcher(this.uv4LogFile.path, false, false, false);
let curPos = 0;
const buf = Buffer.alloc(1024);
watcher.onDidChange(() => {
const stats = statSync(this.uv4LogFile.path);
if (stats && stats.size > 0) {
const buf = Buffer.alloc(1024);
curPos += readSync(fd, buf, 0, 1024, curPos);
this.taskChannel?.appendLine(this.dealBuildLog(buf));
const numRead = readSync(fd, buf, 0, 1024, curPos);
if (numRead > 0) {
curPos += numRead;
const txt = this.dealBuildLog(buf.slice(0, numRead));
this.taskChannel?.append(txt);
}
}
});

Expand Down Expand Up @@ -1842,7 +1846,7 @@ class ProjectExplorer implements TreeDataProvider<IView> {
for (const uvPath of uvList) {
try {
// console.log('prj uvFile start', uvPath);
channel.appendLine(uvPath);
// channel.appendLine(uvPath);
await this.openProject(uvPath);
} catch (error) {
channel.appendLine(`Error: open project ${error}`);
Expand Down

0 comments on commit 119a27f

Please sign in to comment.