Tempo: Wrap the autocomplete value for a tag in double quotes (#55610)

This commit is contained in:
Hamas Shafiq 2022-09-22 18:37:46 +01:00 committed by GitHub
parent ff7225745a
commit 4be78095c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,12 +75,13 @@ export default class TempoLanguageProvider extends LanguageProvider {
tagName = tagName.split('=')[0];
const response = await this.request(`/api/search/tag/${tagName}/values`, []);
const suggestions: CompletionItemGroup[] = [];
if (response && response.tagValues) {
suggestions.push({
label: `Tag Values`,
items: response.tagValues.map((tagValue: string) => ({ label: tagValue })),
items: response.tagValues.map((tagValue: string) => ({ label: tagValue, insertText: `"${tagValue}"` })),
});
}
return { suggestions };