-
Notifications
You must be signed in to change notification settings - Fork 79
feat(autocomplete): turn on new autocompleter by default MONGOSH-2885 #2549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,7 +441,7 @@ class MongoshNodeRepl implements EvaluationListener { | |
let newMongoshCompleter: (line: string) => Promise<CompletionResults>; | ||
let oldMongoshCompleter: (line: string) => Promise<CompletionResults>; | ||
|
||
if (process.env.USE_NEW_AUTOCOMPLETE) { | ||
if (process.env.USE_NEW_AUTOCOMPLETE !== '0') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] The magic string comparison !== '0' is repeated across multiple files; consider introducing a helper (e.g., function isNewAutocompleteEnabled(env = process.env) { return env.USE_NEW_AUTOCOMPLETE !== '0'; }) to centralize the flag semantics and avoid divergence. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not a horrible idea. If we had it centralized like that, it'd have made it easier to flip the flag. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we can still do this if you prefer? I think this is something that would primarily have made sense when we first introduced the flag |
||
// we will lazily instantiate the new autocompleter on first use | ||
} else { | ||
const autocompleteParams = instanceState.getAutocompleteParameters(); | ||
|
@@ -461,7 +461,7 @@ class MongoshNodeRepl implements EvaluationListener { | |
return nodeResults; | ||
})(), | ||
(async () => { | ||
if (process.env.USE_NEW_AUTOCOMPLETE) { | ||
if (process.env.USE_NEW_AUTOCOMPLETE !== '0') { | ||
if (!newMongoshCompleter) { | ||
newMongoshCompleter = await initNewAutocompleter(instanceState); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want to turn this on for the embedded shell for no at all? It is likely going to depend on Sergey's work to bundle this in Compass. Or at least be something we want to be extra careful with.