Skip to content

Commit

Permalink
Remove unused file and invalid option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aincvy committed Jan 3, 2024
1 parent 461a1b7 commit d8e6ca5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 35 deletions.
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "fauxpilot",
"displayName": "Fauxpilot",
"description": "Get completions from Fauxpilot server",
"version": "10.0.1",
"version": "10.0.2",
"icon": "assets/icon.png",
"keywords": [
"code-suggestion",
Expand Down Expand Up @@ -116,11 +116,6 @@
"default": ["\n"],
"description": "Valid options: empty array, \\n. You cannot expect other values to take effect. This should be a backend issue, not a problem with this plugin."
},
"fauxpilot.trim1stLineBreak": {
"type":"boolean",
"default": false,
"description": "Should it be removed if there are no characters before the first `\\n`, or if there are only spaces?"
},
"fauxpilot.resendIfEmptyResponse" : {
"type": "boolean",
"default" : false,
Expand All @@ -133,7 +128,7 @@
},
"fauxpilot.trimLeadingWhitespace": {
"type": "boolean",
"default": false,
"default": true,
"description": "Trim leading whitespaces from returned text if the prompt ends in whitespace or if there are multiple white spaces returned."
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Constants.ts

This file was deleted.

9 changes: 1 addition & 8 deletions src/FauxpilotClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class FauxpilotClient {
private serverMaxTokens: number;
private leadingLinesRatio: number;
private reduceLineTryTimes: number;
private trim1stLineBreak = false;
private resendIfEmptyResponse = false;
private fetchWithoutLineBreak = false;
private trimLeadingWhitespace = false;
Expand Down Expand Up @@ -80,7 +79,6 @@ export class FauxpilotClient {
this.maxLines = extConfig.get("maxLines", 150);
this.serverMaxTokens = extConfig.get("serverMaxTokens", 2048);
this.reduceLineTryTimes = extConfig.get("reduceLineTryTimes", 2);
this.trim1stLineBreak = extConfig.get("trim1stLineBreak", false);
this.resendIfEmptyResponse = extConfig.get("resendIfEmptyResponse", false);
this.trimLeadingWhitespace = extConfig.get("trimLeadingWhitespace", false);

Expand All @@ -97,7 +95,6 @@ export class FauxpilotClient {
this.log(`maxLines = ${this.maxLines}`);
this.log(`serverMaxTokens = ${this.serverMaxTokens}`);
this.log(`reduceLineTryTimes = ${this.reduceLineTryTimes}`);
this.log(`trim1stLineBreak = ${this.trim1stLineBreak}`);
this.log(`resendIfEmptyResponse = ${this.resendIfEmptyResponse}`);
this.log(`trimLeadingWhitespace = ${this.trimLeadingWhitespace}`);

Expand Down Expand Up @@ -186,11 +183,7 @@ export class FauxpilotClient {
public get ReduceLineTryTimes(): number {
return this.reduceLineTryTimes;
}

public get IsTrim1stLineBreak(): boolean {
return this.trim1stLineBreak;
}


public get ResendIfEmptyResponse(): boolean {
return this.resendIfEmptyResponse;
}
Expand Down
18 changes: 0 additions & 18 deletions src/FauxpilotCompletionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from 'vscode';

import { nextId,delay, limitTextLength } from './Utils';
import { LEADING_LINES_PROP } from './Constants';
import { fauxpilotClient } from './FauxpilotClient';
import { fetch } from './AccessBackend';

Expand Down Expand Up @@ -199,23 +198,6 @@ export class FauxpilotCompletionProvider implements InlineCompletionItemProvider
return [];
}

if (fauxpilotClient.IsTrim1stLineBreak) {
const lineIndex = choice1Text.indexOf("\n");
if (lineIndex >= 0) {
let erase = true;
for (let i = 0; i < lineIndex; i++){
if (choice1Text[i] != " ") {
erase = false;
break;
}
}

if (erase) {
choice1Text = choice1Text.substring(lineIndex + 1);
}
}
}

if (fauxpilotClient.TrimLeadingWhitespace) {
const trailingWhiteSpace = promptStr.endsWith(" ");
if (trailingWhiteSpace) {
Expand Down

0 comments on commit d8e6ca5

Please sign in to comment.