Skip to content

Commit 44c686f

Browse files
committed
Fix brace expansion completion bug
1 parent 573b737 commit 44c686f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,12 @@ 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+
}
392397
}
393398

394399
return allCompletions

0 commit comments

Comments
 (0)