Skip to content

Commit eb0c6a8

Browse files
authored
Merge pull request #4037 from RedisInsight/release/2.60.0
Release/2.60.0 to latest
2 parents f8ef3dd + 298f42c commit eb0c6a8

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

redisinsight/ui/src/pages/workbench/utils/monaco.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const getRediSearchSignutureProvider = (options: Maybe<{
6161
const parentToken = token.token || token.arguments?.[0]?.token
6262
const parentTokenPosition = parentToken ? label.indexOf(parentToken) : 0
6363
const wordRegex = new RegExp(`\\b${arg}\\b`, 'g')
64-
const startPosition = wordRegex.exec(label.slice(parentTokenPosition))?.index || 0
64+
const startPosition = (wordRegex.exec(label.slice(parentTokenPosition))?.index || 0) + parentTokenPosition
6565
signaturePosition = [startPosition, startPosition + arg.length]
6666
}
6767

redisinsight/ui/src/pages/workbench/utils/searchSuggestions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ export const findSuggestionsByArg = (
3636
const { prevCursorChar } = cursor
3737
const [beforeOffsetArgs, [currentOffsetArg]] = args
3838

39+
const startCommentIndex = beforeOffsetArgs.findIndex((el) => el.startsWith('//'))
40+
if (startCommentIndex > -1 || currentOffsetArg?.startsWith('//')) {
41+
return {
42+
suggestions: asSuggestionsRef([]),
43+
helpWidget: { isOpen: false }
44+
}
45+
}
46+
3947
const scopedList = command.name
4048
? listOfCommands.filter(({ token }) => token === command?.name)
4149
: listOfCommands

redisinsight/ui/src/utils/monaco/monacoRedisMonarchTokensProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const getRedisMonarchTokensProvider = (commands: IRedisCommand[]): monaco
4949
],
5050
whitespace: [
5151
[/\s+/, 'white'],
52-
[/\/\/.*$/, 'comment'],
52+
[/\/\/.*/, 'comment'],
5353
],
5454
numbers: [
5555
[/0[xX][0-9a-fA-F]*/, 'number'],

redisinsight/ui/src/utils/monaco/monarchTokens/redisearchTokensSubRedis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const getRediSearchSubRedisMonarchTokensProvider = (
100100
],
101101
whitespace: [
102102
[/\s+/, 'white'],
103-
[/\/\/.*$/, 'comment'],
103+
[/\/\/.*/, 'comment'],
104104
],
105105
numbers: [
106106
[/0[xX][0-9a-fA-F]*/, 'number'],

0 commit comments

Comments
 (0)