🩹 small tweaks to stop words
This commit is contained in:
parent
e4d7b16238
commit
f86016b73e
1 changed files with 15 additions and 10 deletions
|
|
@ -51,6 +51,21 @@ export interface AutocompleteOutcome extends TabAutocompleteOptions {
|
|||
|
||||
const autocompleteCache = AutocompleteLruCache.get();
|
||||
|
||||
const DOUBLE_NEWLINE = "\n\n";
|
||||
const WINDOWS_DOUBLE_NEWLINE = "\r\n\r\n";
|
||||
const SRC_DIRECTORY = "/src/";
|
||||
const STARCODER2_T_ARTIFACT = "t.";
|
||||
const PYTHON_ENCODING = "#- coding: utf-8";
|
||||
const CODE_BLOCK_END = "```";
|
||||
|
||||
const multilineStops = [DOUBLE_NEWLINE, WINDOWS_DOUBLE_NEWLINE];
|
||||
const commonStops = [
|
||||
SRC_DIRECTORY,
|
||||
STARCODER2_T_ARTIFACT,
|
||||
PYTHON_ENCODING,
|
||||
CODE_BLOCK_END,
|
||||
];
|
||||
|
||||
function formatExternalSnippet(
|
||||
filepath: string,
|
||||
snippet: string,
|
||||
|
|
@ -204,16 +219,6 @@ export async function getTabCompletion(
|
|||
cacheHit = true;
|
||||
completion = cachedCompletion;
|
||||
} else {
|
||||
const DOUBLE_NEWLINE = "\n\n";
|
||||
const WINDOWS_DOUBLE_NEWLINE = "\r\n\r\n";
|
||||
const SRC_DIRECTORY = "/src/";
|
||||
const T_FILE_EXTENSION = ".t.";
|
||||
const PYTHON_ENCODING = "#- coding: utf-8";
|
||||
const CODE_BLOCK_END = "```";
|
||||
|
||||
const multilineStops = [DOUBLE_NEWLINE, WINDOWS_DOUBLE_NEWLINE];
|
||||
const commonStops = [SRC_DIRECTORY, T_FILE_EXTENSION, PYTHON_ENCODING, CODE_BLOCK_END];
|
||||
|
||||
let stop = [
|
||||
...(completionOptions?.stop || []),
|
||||
...multilineStops,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue