Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ describe('TS Autocomplete', () => {
]);
});

test('can suggest timeseries after one already selected', async () => {
const suggestions = await suggest('TS timeseries_index, ');
const labels = suggestions.map((s) => s.label);

expect(labels).toEqual(['timeseries_index_with_alias', 'time_series_index']);
});

test('discriminates between indices and aliases', async () => {
const suggestions = await suggest('TS ');
const indices: string[] = suggestions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ export async function autocomplete(
// TS something/
// TS something, /
else if (indexes.length) {
const sources = context?.sources ?? [];
const timeSeriesSources =
context?.timeSeriesSources?.map(({ name }) => ({ name, hidden: false })) ?? [];

const additionalSuggestions = await additionalSourcesSuggestions(
innerText,
sources,
timeSeriesSources,
indexes.map(({ name }) => name),
[]
);
Expand Down