Update completionProvider.ts
as @rootedbox suggested
This commit is contained in:
parent
91846d7181
commit
26c2f2fc9b
1 changed files with 13 additions and 5 deletions
|
|
@ -203,13 +203,20 @@ export async function getTabCompletion(
|
|||
cacheHit = true;
|
||||
completion = cachedCompletion;
|
||||
} else {
|
||||
// Try to reuse pending requests if what the user typed matches start of completion
|
||||
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 || []),
|
||||
"\n\n",
|
||||
"\r\n\r\n",
|
||||
"/src/",
|
||||
"```",
|
||||
...multilineStops,
|
||||
...commonStops,
|
||||
...lang.stopWords,
|
||||
];
|
||||
|
||||
|
|
@ -217,6 +224,7 @@ export async function getTabCompletion(
|
|||
options.multilineCompletions !== "never" &&
|
||||
(options.multilineCompletions === "always" || completeMultiline);
|
||||
|
||||
// Try to reuse pending requests if what the user typed matches start of completion
|
||||
let generator = generatorReuseManager.getGenerator(
|
||||
prefix,
|
||||
() =>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue