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

## Summary

This PR fixes autocomplete on only 1 letter typed in request editor.

Closes #164542

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release note

Fixes autocomplete on only 1 letter typed in Console's request editor
This commit is contained in:
Youhei Sakurai 2023-09-01 10:26:22 +09:00 committed by GitHub
parent d117fae85c
commit eaee02f913
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View file

@ -1077,11 +1077,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
}

View file

@ -48,7 +48,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe.skip('anti-regression watchdogs', () => {
beforeEach(async () => {
await PageObjects.console.clearTextArea();
await PageObjects.console.pressEnter();
});
it('should suppress auto-complete on arrow keys', async () => {
@ -92,7 +91,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();