Skip to content

Commit 4241bb6

Browse files
committed
Update expansion prefix and document handler
1 parent 1788538 commit 4241bb6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { BashCompletionItem, CompletionItemDataType } from './types'
1313
import { uniqueBasedOnHash } from './util/array'
1414
import { getShellDocumentation } from './util/sh'
1515

16-
const PARAMETER_EXPANSION_PREFIXES = new Set(['$', '${', '${#'])
16+
const PARAMETER_EXPANSION_PREFIXES = new Set(['$', '${'])
1717

1818
/**
1919
* The BashServer glues together the separate components to implement
@@ -331,6 +331,10 @@ export default class BashServer {
331331
})
332332

333333
if (shouldCompleteOnVariables) {
334+
// In case we auto complete on a word that starts a parameter expansion,
335+
// we do not return anything else than variable/parameter suggestions.
336+
// Note: that LSP clients should not call onCompletion in the middle
337+
// of a word, so the following should work for client.
334338
return symbolCompletions
335339
}
336340

0 commit comments

Comments
 (0)