Repository: TabbyML/tabby
File: clients/vscode/src/Commands.ts (TypeScript)

Code before:
    },
    gettingStarted: () => {
      commands.executeCommand("workbench.action.openWalkthrough", "TabbyML.vscode-tabby#gettingStarted");
    },
    "commandPalette.trigger": () => {
      new CommandPalette(this.client, this.config, this.issues);
    },
    "outputPanel.focus": () => {
      showOutputPanel();
    },
    "inlineCompletion.trigger": () => {
      commands.executeCommand("editor.action.inlineSuggest.trigger");
    },
    "inlineCompletion.accept": () => {
      const editor = window.activeTextEditor;
      if (!editor) {
        return;
      }

      commands.executeCommand("editor.action.inlineSuggest.commit");

      const uri = editor.document.uri;
      const range = this.inlineCompletionProvider.getCurrentDisplayRange();
      if (!range) {
        return;
      }
      applyQuickFixes(uri, range);
    },
    "inlineCompletion.acceptNextWord": () => {
      this.inlineCompletionProvider.handleEvent("accept_word");
      commands.executeCommand("editor.action.inlineSuggest.acceptNextWord");
    },
    "inlineCompletion.acceptNextLine": () => {
      this.inlineCompletionProvider.handleEvent("accept_line");
      // FIXME: this command move cursor to next line, but we want to move cursor to the end of current line
      commands.executeCommand("editor.action.inlineSuggest.acceptNextLine");
    },
    "inlineCompletion.dismiss": () => {
      this.inlineCompletionProvider.handleEvent("dismiss");
      commands.executeCommand("editor.action.inlineSuggest.hide");
    },
    "notifications.mute": (type: string) => {
      const notifications = this.config.mutedNotifications;
      if (!notifications.includes(type)) {
        const updated = notifications.concat(type);
        this.config.mutedNotifications = updated;
      }
    },
    "notifications.resetMuted": (type?: string) => {
      const notifications = this.config.mutedNotifications;
      if (type) {

Review comment (suggestion):

```suggestion

      const range = this.inlineCompletionProvider.getCurrentDisplayRange();
      await commands.executeCommand("editor.action.inlineSuggest.commit");

      const uri = editor.document.uri;
      if (!range) {
        return;
      }
```


Code after:
    },
    gettingStarted: () => {
      commands.executeCommand("workbench.action.openWalkthrough", "TabbyML.vscode-tabby#gettingStarted");
    },
    "commandPalette.trigger": () => {
      new CommandPalette(this.client, this.config, this.issues);
    },
    "outputPanel.focus": () => {
      showOutputPanel();
    },
    "inlineCompletion.trigger": () => {
      commands.executeCommand("editor.action.inlineSuggest.trigger");
    },
    "inlineCompletion.accept": async () => {
      const editor = window.activeTextEditor;
      if (!editor) {
        return;
      }

      const uri = editor.document.uri;
      const range = this.inlineCompletionProvider.calcEditedRangeAfterAccept();

      await commands.executeCommand("editor.action.inlineSuggest.commit");

      if (range) {
        applyQuickFixes(uri, range);
      }
    },
    "inlineCompletion.acceptNextWord": () => {
      this.inlineCompletionProvider.handleEvent("accept_word");
      commands.executeCommand("editor.action.inlineSuggest.acceptNextWord");
    },
    "inlineCompletion.acceptNextLine": () => {
      this.inlineCompletionProvider.handleEvent("accept_line");
      // FIXME: this command move cursor to next line, but we want to move cursor to the end of current line
      commands.executeCommand("editor.action.inlineSuggest.acceptNextLine");
    },
    "inlineCompletion.dismiss": () => {
      this.inlineCompletionProvider.handleEvent("dismiss");
      commands.executeCommand("editor.action.inlineSuggest.hide");
    },
    "notifications.mute": (type: string) => {
      const notifications = this.config.mutedNotifications;
      if (!notifications.includes(type)) {
        const updated = notifications.concat(type);
        this.config.mutedNotifications = updated;
      }
    },
    "notifications.resetMuted": (type?: string) => {
      const notifications = this.config.mutedNotifications;
      if (type) {