mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
support [[var]] notation
This commit is contained in:
parent
f03da8bb3a
commit
10012f8ffe
@ -13,14 +13,24 @@ export class PromCompleter {
|
||||
this.labelQueryCache = {};
|
||||
this.labelNameCache = {};
|
||||
this.labelValueCache = {};
|
||||
this.templateVariableCompletions = this.templateSrv.variables.map(variable => {
|
||||
return {
|
||||
caption: '$' + variable.name,
|
||||
value: '$' + variable.name,
|
||||
meta: 'variable.other',
|
||||
score: Number.MAX_VALUE,
|
||||
};
|
||||
});
|
||||
this.templateVariableCompletions = _.flatten(
|
||||
this.templateSrv.variables.map(variable => {
|
||||
return [
|
||||
{
|
||||
caption: '$' + variable.name,
|
||||
value: '$' + variable.name,
|
||||
meta: 'variable.other',
|
||||
score: Number.MAX_VALUE,
|
||||
},
|
||||
{
|
||||
caption: '[[' + variable.name + ']',
|
||||
value: '[[' + variable.name + ']',
|
||||
meta: 'variable.other',
|
||||
score: Number.MAX_VALUE,
|
||||
},
|
||||
];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
getCompletions(editor, session, pos, prefix, callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user