Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
2d29997b
Unverified
Commit
2d29997b
authored
May 11, 2020
by
Andrej Ocenas
Committed by
GitHub
May 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CloudWatch/Logs: Fix suggestions of fields after comma (#24520)
parent
9dd68dae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
public/app/plugins/datasource/cloudwatch/language_provider.test.ts
+4
-0
public/app/plugins/datasource/cloudwatch/language_provider.ts
+1
-1
No files found.
public/app/plugins/datasource/cloudwatch/language_provider.test.ts
View file @
2d29997b
...
...
@@ -40,6 +40,10 @@ describe('CloudWatchLanguageProvider', () => {
await runSuggestionTest('
fields
field1
,
\\
', [fields, FUNCTIONS.map(v => v.label)]);
});
it('
should
suggest
fields
and
functions
after
comma
with
prefix
', async () => {
await runSuggestionTest('
fields
field1
,
@
mess
\\
', [fields, FUNCTIONS.map(v => v.label)]);
});
it('
should
suggest
fields
and
functions
after
display
command
', async () => {
await runSuggestionTest('
display
\\
', [fields, FUNCTIONS.map(v => v.label)]);
});
...
...
public/app/plugins/datasource/cloudwatch/language_provider.ts
View file @
2d29997b
...
...
@@ -165,7 +165,7 @@ export class CloudWatchLanguageProvider extends LanguageProvider {
const
currentTokenIsComma
=
curToken
.
content
===
','
&&
curToken
.
types
.
includes
(
'punctuation'
);
const
currentTokenIsCommaOrAfterComma
=
currentTokenIsComma
||
(
curToken
.
prev
?.
content
===
','
&&
curToken
.
prev
.
types
.
includes
(
'punctuation'
));
currentTokenIsComma
||
(
prevToken
?.
content
===
','
&&
prevToken
?
.
types
.
includes
(
'punctuation'
));
// We only show suggestions if we are after a command or after a comma which is a field separator
if
(
!
(
currentTokenIsAfterCommand
||
currentTokenIsCommaOrAfterComma
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment