🔧 option to disable autocomplete from config.json
This commit is contained in:
parent
c54cd7a26d
commit
4f225349f0
5 changed files with 13 additions and 0 deletions
|
|
@ -384,6 +384,11 @@ export class CompletionProvider {
|
|||
...config.tabAutocompleteOptions,
|
||||
};
|
||||
|
||||
// Allow disabling autocomplete from config.json
|
||||
if (options.disable) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (CompletionProvider.debouncing) {
|
||||
CompletionProvider.debounceTimeout?.refresh();
|
||||
const lastUUID = await new Promise((resolve) =>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { TabAutocompleteOptions } from "..";
|
||||
|
||||
export const DEFAULT_AUTOCOMPLETE_OPTS: TabAutocompleteOptions = {
|
||||
disable: false,
|
||||
useCopyBuffer: false,
|
||||
useSuffix: true,
|
||||
maxPromptTokens: 500,
|
||||
|
|
|
|||
1
core/index.d.ts
vendored
1
core/index.d.ts
vendored
|
|
@ -630,6 +630,7 @@ export interface EmbeddingsProvider {
|
|||
}
|
||||
|
||||
export interface TabAutocompleteOptions {
|
||||
disable: boolean;
|
||||
useCopyBuffer: boolean;
|
||||
useSuffix: boolean;
|
||||
maxPromptTokens: number;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ This object allows you to customize the behavior of tab-autocomplete. The availa
|
|||
- `multilineCompletions`: Whether to enable multiline completions ("always", "never", or "auto"). Defaults to "auto".
|
||||
- `useCache`: Whether to cache and reuse completions when the prompt is the same as a previous one. May be useful to disable for testing purposes.
|
||||
- `useOtherFiles`: Whether to include context from files outside of the current one. Turning this off should be expected to reduce the accuracy of completions, but might be good for testing.
|
||||
- `disable`: Disable autocomplete (can also be done from IDE settings)
|
||||
|
||||
### Full example
|
||||
|
||||
|
|
|
|||
|
|
@ -1674,6 +1674,11 @@
|
|||
"type": "object",
|
||||
"markdownDescription": "These options let you customize your tab-autocomplete experience. Read about all options in [the docs](https://continue.dev/docs/walkthroughs/tab-autocomplete#configuration-options).",
|
||||
"properties": {
|
||||
"disable": {
|
||||
"type": "boolean",
|
||||
"description": "Disable tab autocomplete. This can also be done from the IDE settings.",
|
||||
"default": false
|
||||
},
|
||||
"useCopyBuffer": {
|
||||
"type": "boolean",
|
||||
"description": "Determines whether the copy buffer will be considered when contructing the prompt."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue