Reputation: 494
I want to ask if someone knows about way how to enable autocomplete (intellisense) for variable names inside of quotes in visual studio code.
For example, php function compact takes literally name of variable as argument, so we have to place it to the function inside of quotes, just like this: compact('posts')
and not compact($posts)
. The problem here is that as long as its not stated with $, intellisense will not trigger any suggestions for available variables.
Currently Im using php intelephense as php intellisense extension for vs code. Is it matter of right extension or some setting of particular extension or am I trying to achieve something that is not currently available? (I would like to also achieve suggesting of paths with '.' notation inside of quotes that is typical for example for laravel where view('posts.show')
= view('posts/show')
)
Thanks
Upvotes: 3
Views: 2242
Reputation: 9
Go to settings Go to Word Seperators
Remove " from the string that defines word separators
Upvotes: 0
Reputation: 494
I've managed to partly solve this problem by changing of editor.quickSuggestions
setting, just like this:
"editor.quickSuggestions": {
"strings": true
}
This will enable suggestions for strings as well, however suggestions for variable names in compact()
function will still not work, looks like its more specific issue of php language server implementation in vs code.
Upvotes: 4