admin管理员组

文章数量:1022670

In VS Code, how can I make variable names auto-complete without typing the $ symbol? For example, when I type data, it should automatically suggest and complete it as $data. When I used IntelliJ IDEA before, it worked like this. How can I achieve the same behavior in VS Code?

I have already installed PHP Intelephense ext

In VS Code, how can I make variable names auto-complete without typing the $ symbol? For example, when I type data, it should automatically suggest and complete it as $data. When I used IntelliJ IDEA before, it worked like this. How can I achieve the same behavior in VS Code?

I have already installed PHP Intelephense ext

Share Improve this question asked Nov 28, 2024 at 10:07 CamusLCamusL 1 2
  • 2 How should it know you do not mean a keyword instead of a variable? – Markus Zeller Commented Nov 28, 2024 at 10:10
  • 1 @MarkusZeller In most languages, variables don't start with a special character, yet auto-completion does work. – Olivier Commented Nov 28, 2024 at 10:21
Add a comment  | 

1 Answer 1

Reset to default 0

It seems PHP IntelliSense extension works better and might be more suitable in your case than PHP Intelephense extension. At least from its homepage, it seems it could help you autocomplete without $. There are couple of examples on how to using the extension.

In VS Code, how can I make variable names auto-complete without typing the $ symbol? For example, when I type data, it should automatically suggest and complete it as $data. When I used IntelliJ IDEA before, it worked like this. How can I achieve the same behavior in VS Code?

I have already installed PHP Intelephense ext

In VS Code, how can I make variable names auto-complete without typing the $ symbol? For example, when I type data, it should automatically suggest and complete it as $data. When I used IntelliJ IDEA before, it worked like this. How can I achieve the same behavior in VS Code?

I have already installed PHP Intelephense ext

Share Improve this question asked Nov 28, 2024 at 10:07 CamusLCamusL 1 2
  • 2 How should it know you do not mean a keyword instead of a variable? – Markus Zeller Commented Nov 28, 2024 at 10:10
  • 1 @MarkusZeller In most languages, variables don't start with a special character, yet auto-completion does work. – Olivier Commented Nov 28, 2024 at 10:21
Add a comment  | 

1 Answer 1

Reset to default 0

It seems PHP IntelliSense extension works better and might be more suitable in your case than PHP Intelephense extension. At least from its homepage, it seems it could help you autocomplete without $. There are couple of examples on how to using the extension.

本文标签: phpHow to autocomplete variables in VS Code without typing thesymbolStack Overflow