Skip to content

Commit

Permalink
vscode-ext: improve "Copy Command" command and other minor stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp15b committed Dec 22, 2024
1 parent 7010978 commit 1438e65
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions vscode-ext/src/CaesarClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,12 @@ export class CaesarClient {
return;
}
const command = '"' + executable.command.replace(/(["'$`\\])/g, '\\$1') + '"';
let line = `${command} ${executable.args!.join(" ")}`;
const args = executable.args!.filter(arg => !["--language-server", "--debug"].includes(arg));
let line = `${command} ${args.join(" ")}`;
let cwd = executable.options && executable.options.cwd;
if (cwd !== undefined) {
cwd = '"' + cwd.replace(/(["'$`\\])/g, '\\$1') + '"';
line = `pushd ${cwd}; ${line}; popd`;
line = `cd ${cwd}; ${line}`;
}
await vscode.env.clipboard.writeText(line);
}
Expand Down
2 changes: 1 addition & 1 deletion vscode-ext/src/ComputedPreComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ComputedPreComponent {

// clear all information when a new verification task is started
verifier.client.onStatusUpdate((status) => {
if (status == ServerStatus.Verifying) {
if (status === ServerStatus.Verifying) {
for (const [_document, results] of this.computedPres.entries()) {
results.length = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion vscode-ext/src/GutterStatusComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class GutterStatusComponent {

// listen to status and verify updates
verifier.client.onStatusUpdate((status) => {
if (status == ServerStatus.Verifying) {
if (status === ServerStatus.Verifying) {
for (const [_document, results] of this.status.entries()) {
results.length = 0;
}
Expand Down
8 changes: 4 additions & 4 deletions vscode-ext/src/StatusBarComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const stoppedTooltipMenu =
export class StatusBarComponent {

private enabled: boolean;
private verifyStatus: DocumentMap<[Range, VerifyResult][]> = new DocumentMap();
private verifyStatus = new DocumentMap<[Range, VerifyResult][]>();
private serverStatus: ServerStatus = ServerStatus.NotStarted;
private view: StatusBarItem;

Expand Down Expand Up @@ -95,7 +95,7 @@ export class StatusBarComponent {
break;
case ServerStatus.Starting:
viewText = "$(loading~spin) Starting Caesar...";
command = "caesar.showOutput"
command = "caesar.showOutput";
break;
case ServerStatus.Ready:
[viewText, tooltipStatusText] = this.getReadyStatusView();
Expand All @@ -104,7 +104,7 @@ export class StatusBarComponent {
break;
case ServerStatus.Verifying:
viewText = "$(sync~spin) Verifying...";
command = "caesar.showOutput"
command = "caesar.showOutput";
break;
}

Expand Down Expand Up @@ -150,7 +150,7 @@ export class StatusBarComponent {

const results = this.verifyStatus.get(document_id);

if (results === undefined) throw new Error("No verify results found for document: " + document_id);
if (results === undefined) { throw new Error("No verify results found for document: " + document_id.uri); }

let verified = 0;
let failed = 0;
Expand Down

0 comments on commit 1438e65

Please sign in to comment.