Skip to content

Commit c54c40f

Browse files
committed
* #RI-2150 - Hints with arguments are opened on Ctrl+Space together with commands suggestions list
* #RI-2079 - Line for argument in autocomplete in Workbench * #RI-2151 - Command suggestion list is not displayed for FT. commands after command correction
1 parent fd4f50d commit c54c40f

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-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: 8 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,13 @@ export const getRedisMonarchTokensProvider = (commands: string[]): monacoEditor.
4748
],
4849
[/[<>=!%&+\-*/|~^]/, 'operator'],
4950
],
51+
keyword: [
52+
[
53+
`(${commands.join('|')})\\b`,
54+
// '(important|true)\\b',
55+
'keyword'
56+
]
57+
],
5058
whitespace: [
5159
[/\s+/, 'white'],
5260
[/\/\/.*$/, 'comment'],

0 commit comments

Comments
 (0)