Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion redisinsight/ui/src/pages/workbench/utils/monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const getRediSearchSignutureProvider = (options: Maybe<{
const parentToken = token.token || token.arguments?.[0]?.token
const parentTokenPosition = parentToken ? label.indexOf(parentToken) : 0
const wordRegex = new RegExp(`\\b${arg}\\b`, 'g')
const startPosition = wordRegex.exec(label.slice(parentTokenPosition))?.index || 0
const startPosition = (wordRegex.exec(label.slice(parentTokenPosition))?.index || 0) + parentTokenPosition
signaturePosition = [startPosition, startPosition + arg.length]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export const findSuggestionsByArg = (
const { prevCursorChar } = cursor
const [beforeOffsetArgs, [currentOffsetArg]] = args

const startCommentIndex = beforeOffsetArgs.findIndex((el) => el.startsWith('//'))
if (startCommentIndex > -1 || currentOffsetArg?.startsWith('//')) {
return {
suggestions: asSuggestionsRef([]),
helpWidget: { isOpen: false }
}
}

const scopedList = command.name
? listOfCommands.filter(({ token }) => token === command?.name)
: listOfCommands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const getRedisMonarchTokensProvider = (commands: IRedisCommand[]): monaco
],
whitespace: [
[/\s+/, 'white'],
[/\/\/.*$/, 'comment'],
[/\/\/.*/, 'comment'],
],
numbers: [
[/0[xX][0-9a-fA-F]*/, 'number'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const getRediSearchSubRedisMonarchTokensProvider = (
],
whitespace: [
[/\s+/, 'white'],
[/\/\/.*$/, 'comment'],
[/\/\/.*/, 'comment'],
],
numbers: [
[/0[xX][0-9a-fA-F]*/, 'number'],
Expand Down
Loading