Skip to content

Commit 302b6a0

Browse files
Merge pull request #98 from RedisInsight/feature/bugfix
#RI-2150, #RI-2079, #RI-2151
2 parents 888586e + 1c2e55d commit 302b6a0

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

redisinsight/ui/src/components/query/Query/Query.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ const Query = (props: Props) => {
114114
}
115115
}
116116

117-
const onKeyDownMonaco = (e:monacoEditor.IKeyboardEvent) => {
117+
const onKeyDownMonaco = (e: monacoEditor.IKeyboardEvent) => {
118+
// trigger parameter hints
118119
if (
119120
e.keyCode === monaco.KeyCode.Tab
120-
|| e.keyCode === monaco.KeyCode.Space
121121
|| e.keyCode === monaco.KeyCode.Enter
122+
|| (e.keyCode === monaco.KeyCode.Space && e.ctrlKey && e.shiftKey)
123+
|| (e.keyCode === monaco.KeyCode.Space && !e.ctrlKey && !e.shiftKey)
122124
) {
123125
onTriggerParameterHints()
124126
}

redisinsight/ui/src/constants/monacoRedis.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api'
22

33
export const redisLanguageConfig: monacoEditor.languages.LanguageConfiguration = {
4+
wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,
45
comments: {
56
lineComment: '//',
67
// blockComment: ['/*', '*/'],

redisinsight/ui/src/styles/base/_monaco.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
}
2727
}
2828

29+
.monaco-editor .accessibilityHelpWidget {
30+
overflow: auto;
31+
}
32+
2933
.monaco-glyph-run-command {
3034
color: var(--rsSubmitBtn);
3135
opacity: .5 !important;

redisinsight/ui/src/utils/monacoRedisMonarchTokensProvider.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const getRedisMonarchTokensProvider = (commands: string[]): monacoEditor.
3131
{ include: '@numbers' },
3232
{ include: '@strings' },
3333
{ include: '@scopes' },
34+
{ include: '@keyword' },
3435
[/[;,.]/, 'delimiter'],
3536
[/[()]/, '@brackets'],
3637
[
@@ -47,6 +48,12 @@ export const getRedisMonarchTokensProvider = (commands: string[]): monacoEditor.
4748
],
4849
[/[<>=!%&+\-*/|~^]/, 'operator'],
4950
],
51+
keyword: [
52+
[
53+
`(${commands.join('|')})\\b`,
54+
'keyword'
55+
]
56+
],
5057
whitespace: [
5158
[/\s+/, 'white'],
5259
[/\/\/.*$/, 'comment'],

0 commit comments

Comments
 (0)