Skip to content
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

Fix autocomplete on only 1 letter typed in request editor #164707

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/plugins/console/public/lib/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1076,11 +1076,7 @@ export default function ({
tracer('has started evaluating current token', currentToken);

if (!currentToken) {
if (pos.lineNumber === 1) {
lastEvaluatedToken = null;
tracer('not starting autocomplete due to invalid current token at line 1');
return;
}
lastEvaluatedToken = null;
currentToken = { position: { column: 0, lineNumber: 0 }, value: '', type: '' }; // empty row
}

Expand Down
2 changes: 0 additions & 2 deletions test/functional/apps/console/_autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('anti-regression watchdogs', () => {
beforeEach(async () => {
await PageObjects.console.clearTextArea();
await PageObjects.console.pressEnter();
});

it('should suppress auto-complete on arrow keys', async () => {
Expand Down Expand Up @@ -91,7 +90,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

for (const method of methods) {
await PageObjects.console.clearTextArea();
await PageObjects.console.pressEnter();

for (const char of method.slice(0, -1)) {
await PageObjects.console.sleepForDebouncePeriod();
Expand Down