🔧 add option to always enable multiline completions
This commit is contained in:
parent
c762604fa3
commit
598cd40016
4 changed files with 8 additions and 4 deletions
2
core/index.d.ts
vendored
2
core/index.d.ts
vendored
|
|
@ -581,7 +581,7 @@ export interface TabAutocompleteOptions {
|
|||
maxSuffixPercentage: number;
|
||||
prefixPercentage: number;
|
||||
template?: string;
|
||||
disableMultiLineCompletions?: boolean;
|
||||
multilineCompletions?: "always" | "never" | "auto";
|
||||
}
|
||||
|
||||
export interface SerializedContinueConfig {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ This object allows you to customize the behavior of tab-autocomplete. The availa
|
|||
- `maxSuffixPercentage`: The maximum percentage of the prompt that can be dedicated to the suffix. (Number)
|
||||
- `prefixPercentage`: The percentage of the input that should be dedicated to the prefix. (Number)
|
||||
- `template`: An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables. (String)
|
||||
- `multilineCompletions`: Whether to enable multiline completions ("always", "never", or "auto"). Defaults to "auto".
|
||||
|
||||
### Full example
|
||||
|
||||
|
|
|
|||
|
|
@ -1436,8 +1436,8 @@
|
|||
"type": "string",
|
||||
"description": "An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables."
|
||||
},
|
||||
"disableMultiLineCompletions": {
|
||||
"type": "boolean",
|
||||
"multilineCompletions": {
|
||||
"enum": ["always", "never", "auto"],
|
||||
"description": "If set to true, Continue will only complete a single line at a time."
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -311,7 +311,10 @@ async function getTabCompletion(
|
|||
"```",
|
||||
...lang.stopWords,
|
||||
];
|
||||
if (options.disableMultiLineCompletions || !completeMultiline) {
|
||||
if (
|
||||
options.multilineCompletions !== "always" &&
|
||||
(options.multilineCompletions === "never" || !completeMultiline)
|
||||
) {
|
||||
stop.unshift("\n");
|
||||
}
|
||||
let generator = GeneratorReuseManager.getGenerator(prefix, () =>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue