Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
antimonyGu committed Jan 7, 2025
1 parent 3a926f0 commit 71c209e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/vscode/src/lsp/CodeLensMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ export class CodeLensMiddleware implements VscodeLspCodeLensMiddleware {
return codeLenses;
}

this.removeDecorations(editor);
if (!codeLenses) {
return [];
}

this.removeDecorations(editor);
const result = codeLenses
.map((codeLens) => this.handleCodeLens(codeLens, editor))
.filter((codeLens): codeLens is CodeLens => codeLens !== null);
Expand Down Expand Up @@ -114,8 +114,8 @@ export class CodeLensMiddleware implements VscodeLspCodeLensMiddleware {

private addShortcut(codeLens: CodeLens) {
if (codeLens.command?.arguments?.[0].action === "accept") {
// TODO: read ~/.config/Code/User/keybindings.json from LSP client, then send to LSP server to avoid hardcode.
const acceptShortcut = isBrowser ? "" : ` (${process.platform === "darwin" ? "cmd+enter" : "ctrl+enter"})`;
// FIXME: Read ~/.config/Code/User/keybindings.json from LSP client, then send to LSP server to avoid hardcode.
const acceptShortcut = isBrowser ? '' : ` (${process.platform === 'darwin' ? '⌘+enter' : 'Ctrl+enter'})`;

codeLens.command.title += acceptShortcut;
} else if (codeLens.command?.arguments?.[0].action === "discard") {
Expand Down

0 comments on commit 71c209e

Please sign in to comment.