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 4100fab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 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
10 changes: 7 additions & 3 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?.appendLine(txt);
}
}
});

Expand Down

0 comments on commit 4100fab

Please sign in to comment.