Skip to content

Commit e7bd78b

Browse files
committed
Fix brace expansion completion bug
1 parent 016291a commit e7bd78b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/src/server.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,13 @@ export default class BashServer {
388388

389389
if (word) {
390390
// Filter to only return suffixes of the current word
391-
return allCompletions.filter(item => item.label.startsWith(word))
391+
const validCompletions = allCompletions.filter(item => item.label.startsWith(word))
392+
if (word === '{') {
393+
// prevent a '{' from showing up in completions
394+
// if user is trying to close a brace
395+
return validCompletions.filter(item => item.label !== '{')
396+
}
397+
return validCompletions
392398
}
393399

394400
return allCompletions

0 commit comments

Comments
 (0)