Skip to content

Commit

Permalink
refactor(vscode): rename chatOutline to chatOutlineEnabled
Browse files Browse the repository at this point in the history
fix: fix naming issue
  • Loading branch information
Sma1lboy committed Sep 17, 2024
1 parent 8441371 commit c8ec0a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions clients/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
},
{
"command": "tabby.chat.edit.outline.generate",
"when": "tabby.chatEnabled && tabby.chat.outline"
"when": "tabby.chatEnabled && tabby.chatOutlineEnabled"
},
{
"command": "tabby.chat.edit.stop",
Expand Down Expand Up @@ -423,7 +423,8 @@
{
"command": "tabby.chat.edit.editNLOutline",
"key": "ctrl+y",
"mac": "cmd+y"
"mac": "cmd+y",
"when": "tabby.chatOutlineEnabled"
}
],
"viewsContainers": {
Expand Down Expand Up @@ -492,7 +493,6 @@
"tsc-watch": "^6.2.0",
"tsup": "^8.0.2",
"typescript": "^5.3.2",
"vscode-languageclient": "^9.0.1",
"diff": "^5.2.0"
"vscode-languageclient": "^9.0.1"
}
}
10 changes: 5 additions & 5 deletions clients/vscode/src/ContextVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export class ContextVariables {
) {
this.chatEnabled = this.client.chat.isAvailable;
this.inlineCompletionTriggerMode = config.inlineCompletionTriggerMode;
this.chatOutline = config.chatOutline;
this.chatOutlineEnabled = config.chatOutline;
this.client.chat.on("didChangeAvailability", (params: boolean) => {
this.chatEnabled = params;
});
this.config.on("updated", () => {
this.inlineCompletionTriggerMode = config.inlineCompletionTriggerMode;
this.chatOutline = config.chatOutline;
this.chatOutlineEnabled = config.chatOutline;
});
this.updateChatEditResolving();
window.onDidChangeTextEditorSelection((params) => {
Expand Down Expand Up @@ -98,12 +98,12 @@ export class ContextVariables {
this.inlineCompletionTriggerModeValue = value;
}

get chatOutline(): boolean {
get chatOutlineEnabled(): boolean {
return this.chatOutlineValue;
}

set chatOutline(value: boolean) {
commands.executeCommand("setContext", "tabby.chat.outline", value);
set chatOutlineEnabled(value: boolean) {
commands.executeCommand("setContext", "tabby.chatOutlineEnabled", value);
this.chatOutlineValue = value;
}
}
4 changes: 2 additions & 2 deletions clients/vscode/src/outline/NLOutlinesProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Config } from "../Config";
import OpenAI from "openai";
import generateNLOutlinesPrompt from "../../assets/prompts/generateNLOutlines.txt";
import editNLOutline from "../../assets/prompts/editNLOutline.txt";
import * as Diff from "diff";
import { diffLines } from "diff";

interface ChatNLOutlinesParams {
location: Location;
Expand Down Expand Up @@ -313,7 +313,7 @@ export class NLOutlinesProvider extends EventEmitter<void> implements CodeLensPr
const removed: string[] = [];
const unchanged: string[] = [];

Diff.diffLines(oldCode, newCode).forEach((diff) => {
diffLines(oldCode, newCode).forEach((diff) => {
const lines = diff.value.split("\n").filter((line) => line !== "");
if (diff.added) {
added.push(...lines);
Expand Down

0 comments on commit c8ec0a3

Please sign in to comment.