Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Improve error handling when the swift path is misconfigured ([#1801](https://github.com/swiftlang/vscode-swift/pull/1801))
- Fix an error when performing "Run/Debug Tests Multiple Times" on Linux ([#1824](https://github.com/swiftlang/vscode-swift/pull/1824))
- Fix the `> Swift: Run Swift Script` command not running unless a Swift Package folder is open ([#1832](https://github.com/swiftlang/vscode-swift/pull/1832))
- Fix the SourceKit-LSP diagnostics reported progress ([#1799](https://github.com/swiftlang/vscode-swift/pull/1799))

## 2.11.20250806 - 2025-08-06

Expand Down
14 changes: 10 additions & 4 deletions src/commands/captureDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,15 @@ async function sourcekitDiagnose(ctx: FolderContext, dir: string) {
},
async progress => {
progress.report({ message: "Diagnosing SourceKit-LSP..." });
const writableStream = progressUpdatingWritable(percent =>
progress.report({ message: `Diagnosing SourceKit-LSP: ${percent}%` })
);
let lastProgress = 0;
const writableStream = progressUpdatingWritable(percentStr => {
const percent = parseInt(percentStr, 10);
progress.report({
message: `Diagnosing SourceKit-LSP: ${percent}%`,
increment: percent - lastProgress,
});
lastProgress = percent;
});

await execFileStreamOutput(
serverPath,
Expand Down Expand Up @@ -362,7 +368,7 @@ function progressUpdatingWritable(updateProgress: (str: string) => void): Writab
return new Writable({
write(chunk, _encoding, callback) {
const str = (chunk as Buffer).toString("utf8").trim();
const percent = /^([0-9])+%/.exec(str);
const percent = /^([0-9]+)%/.exec(str);
if (percent && percent[1]) {
updateProgress(percent[1]);
}
Expand Down
Loading