wordPattern defines what's considered as a word in the programming language. Code suggestion features will use this setting to determine word boundaries if wordPattern is set.
I'm not entirely sure this is the best possible fix, but everything I tested seems to work the way I expected and I can auto-complete paths now. For example, I tried creating a variable with a slash in the name, but it still doesn't treat that as a valid variable name.
Two thoughts according to my limited understanding of how this works:
I see that the current value of wordPattern comes straight from the official example. My best guess is that a typical language server doesn't implement path completion, so usually you wouldn't want directory separators included in your word pattern. Nushell's language server does appear to do path completion, though, so it seems to make sense to allow those characters when trying to auto-complete.
Most of the built-in VSCode plugins (including shellscript) don't have a wordPattern defined, so maybe this field isn't even needed most of the time?
This removes
/
and\
from thewordPattern
value in thelanguage-configuration.json
, which fixes #185, allowing path completion to work properly.https://code.visualstudio.com/api/language-extensions/language-configuration-guide#word-pattern
I'm not entirely sure this is the best possible fix, but everything I tested seems to work the way I expected and I can auto-complete paths now. For example, I tried creating a variable with a slash in the name, but it still doesn't treat that as a valid variable name.
Two thoughts according to my limited understanding of how this works:
wordPattern
comes straight from the official example. My best guess is that a typical language server doesn't implement path completion, so usually you wouldn't want directory separators included in your word pattern. Nushell's language server does appear to do path completion, though, so it seems to make sense to allow those characters when trying to auto-complete.wordPattern
defined, so maybe this field isn't even needed most of the time?