🔧 option to disable autocomplete from config.json

This commit is contained in:
Nate Sesti 2024-04-08 08:05:41 -07:00
parent c54cd7a26d
commit 4f225349f0
5 changed files with 13 additions and 0 deletions

View file

@ -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) =>

View file

@ -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
View file

@ -630,6 +630,7 @@ export interface EmbeddingsProvider {
}
export interface TabAutocompleteOptions {
disable: boolean;
useCopyBuffer: boolean;
useSuffix: boolean;
maxPromptTokens: number;

View file

@ -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

View file

@ -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."