-
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 all commits
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 | ||||
---|---|---|---|---|---|---|
|
@@ -20,8 +20,7 @@ function linkTimingInterface(): TimingInterface { | |||||
|
||||||
// Otherwise, use a JS implementation (mostly for development) | ||||||
return { | ||||||
markTime: (category, label) => | ||||||
jsTimingEntries.push([category, label, process.hrtime.bigint()]), | ||||||
markTime: (category, label) => 0, //jsTimingEntries.push([category, label, process.hrtime.bigint()]), | ||||||
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. The markTime function has been replaced with a no-op, so jsTimingEntries is never populated and getTimingData will return empty or stale data; either restore the push logic or remove/adjust getTimingData to reflect the intentional disabling of timing collection.
Suggested change
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. Hm, that looks unintuitive indeed - is it intentional or are you testing something? |
||||||
getTimingData: () => { | ||||||
const data = jsTimingEntries.sort((a, b) => Number(a[2] - b[2])); | ||||||
// Adjust times so that process initialization happens at time 0 | ||||||
|
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.
[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.
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.
This is not a horrible idea. If we had it centralized like that, it'd have made it easier to flip the flag.