VS Code & PHP: No Autocomplete for variables from included files?PHP: Delete an element from an arrayHow do I hide certain files from the sidebar in Visual Studio Code?How do I configure Visual Studio Code to open files always in a new tab?PHP unsets class variables when PDO exception occursLaravel 5.4 composer update errorphp -v and phpinfo versions are differentPhalconPHP install undefined symbol: compiler_globalsLaradock unit testing database errors PDOExceptionVagrant not loading the right versionsUpgrade php7.0 to php7.2

How do I go from 300 unfinished/half written blog posts, to published posts?

Why are there no referendums in the US?

What is the intuitive meaning of having a linear relationship between the logs of two variables?

Is there a problem with hiding "forgot password" until it's needed?

How to write papers efficiently when English isn't my first language?

Failed to fetch jessie backports repository

Class Action - which options I have?

Crossing the line between justified force and brutality

What is the opposite of 'gravitas'?

Hostile work environment after whistle-blowing on coworker and our boss. What do I do?

How to safely derail a train during transit?

Purchasing a ticket for someone else in another country?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

What does 算不上 mean in 算不上太美好的日子?

Two monoidal structures and copowering

How do scammers retract money, while you can’t?

Increase performance creating Mandelbrot set in python

Arithmetic mean geometric mean inequality unclear

How long to clear the 'suck zone' of a turbofan after start is initiated?

Lay out the Carpet

Why escape if the_content isnt?

Anatomically Correct Strange Women In Ponds Distributing Swords

How to pronounce the slash sign

Did Dumbledore lie to Harry about how long he had James Potter's invisibility cloak when he was examining it? If so, why?



VS Code & PHP: No Autocomplete for variables from included files?


PHP: Delete an element from an arrayHow do I hide certain files from the sidebar in Visual Studio Code?How do I configure Visual Studio Code to open files always in a new tab?PHP unsets class variables when PDO exception occursLaravel 5.4 composer update errorphp -v and phpinfo versions are differentPhalconPHP install undefined symbol: compiler_globalsLaradock unit testing database errors PDOExceptionVagrant not loading the right versionsUpgrade php7.0 to php7.2













2















I have just jumped on the Visual Studio Code bandwagon, but have hit my first deal-breaker: I can't get it to autocomplete variables that I've set inside of an included "config.php" file, where I would set variables like:



$some_var = 'something';


Then in another file I would include:



<?php
include 'config.php';

// etc.......


Then, in this file I should be able to start typing $som and hit TAB or ENTER and $some_var would be completed (possibly need to type more letters or select what I actually want if others matched the first few characters...)



With all this editor can do I'm BLOWN away this isn't something that works right out of the box!? really makes me wonder if maybe I am missing something...obviously it prevents errors/typos...not to mention the time saved just typing.



Anyways, here's what I've done:



On the welcome screen there's common options for "what I do" I used the php and javascript options; no keybindings



I then started to install several other extensions that looked promising from youtubers, and at some point noticed this issue...



I uninstalled ALL extensions and just picked the PHP option, no dice.



So then I started adding several "PHP ________" extensions, including; IntelliSense, Intelephense, Autocomplete, etc... ONE-BY-ONE and uninstalling if it didn't work, just in case there was a conflict - still no luck (obviously).



What am I missing guys!? I have not seen anyone else asking about this...I hope I'm just over-complicating it and there's something simple I've overlooked...



THANKS.




For what it's worth:



If I open the test file in a browser and echo the included variables, they're there.



I'm running Mint xfce, with LAMP:



php -v
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


My settings.json has a couple custom things I've added/tried along the way:



// PHP TROUBLESHOOTINGS:
//"files.associations": "*.php": "html",
"files.autoGuessEncoding": true,
"files.defaultLanguage": "php",
"php.suggest.basic": true,

"editor.quickSuggestions":
"other": true,
"comments": true,
"strings": true
,









share|improve this question
























  • Is this even a feature? I know it picks up functions but unsure about variables.

    – Script47
    Mar 7 at 13:09











  • It does work with PHP Intellisense - Crane on my visual code. However on first install it doens't always work instantly. I guess this is an index problem..

    – Wimanicesir
    Mar 7 at 13:32











  • Thanks, funny enough PHP Intellisense - Crane is the last one I installed, and is still installed...I just closed out and restarted, nope. As for if it's a feature - I can't imagine it isn't at least an extension...I've been using Dreamweaver for over a decade and it does it. I also have Geany installed, and even it does it. Definitely a feature I think is a must have.

    – TheFirstMinute
    Mar 7 at 15:11
















2















I have just jumped on the Visual Studio Code bandwagon, but have hit my first deal-breaker: I can't get it to autocomplete variables that I've set inside of an included "config.php" file, where I would set variables like:



$some_var = 'something';


Then in another file I would include:



<?php
include 'config.php';

// etc.......


Then, in this file I should be able to start typing $som and hit TAB or ENTER and $some_var would be completed (possibly need to type more letters or select what I actually want if others matched the first few characters...)



With all this editor can do I'm BLOWN away this isn't something that works right out of the box!? really makes me wonder if maybe I am missing something...obviously it prevents errors/typos...not to mention the time saved just typing.



Anyways, here's what I've done:



On the welcome screen there's common options for "what I do" I used the php and javascript options; no keybindings



I then started to install several other extensions that looked promising from youtubers, and at some point noticed this issue...



I uninstalled ALL extensions and just picked the PHP option, no dice.



So then I started adding several "PHP ________" extensions, including; IntelliSense, Intelephense, Autocomplete, etc... ONE-BY-ONE and uninstalling if it didn't work, just in case there was a conflict - still no luck (obviously).



What am I missing guys!? I have not seen anyone else asking about this...I hope I'm just over-complicating it and there's something simple I've overlooked...



THANKS.




For what it's worth:



If I open the test file in a browser and echo the included variables, they're there.



I'm running Mint xfce, with LAMP:



php -v
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


My settings.json has a couple custom things I've added/tried along the way:



// PHP TROUBLESHOOTINGS:
//"files.associations": "*.php": "html",
"files.autoGuessEncoding": true,
"files.defaultLanguage": "php",
"php.suggest.basic": true,

"editor.quickSuggestions":
"other": true,
"comments": true,
"strings": true
,









share|improve this question
























  • Is this even a feature? I know it picks up functions but unsure about variables.

    – Script47
    Mar 7 at 13:09











  • It does work with PHP Intellisense - Crane on my visual code. However on first install it doens't always work instantly. I guess this is an index problem..

    – Wimanicesir
    Mar 7 at 13:32











  • Thanks, funny enough PHP Intellisense - Crane is the last one I installed, and is still installed...I just closed out and restarted, nope. As for if it's a feature - I can't imagine it isn't at least an extension...I've been using Dreamweaver for over a decade and it does it. I also have Geany installed, and even it does it. Definitely a feature I think is a must have.

    – TheFirstMinute
    Mar 7 at 15:11














2












2








2


2






I have just jumped on the Visual Studio Code bandwagon, but have hit my first deal-breaker: I can't get it to autocomplete variables that I've set inside of an included "config.php" file, where I would set variables like:



$some_var = 'something';


Then in another file I would include:



<?php
include 'config.php';

// etc.......


Then, in this file I should be able to start typing $som and hit TAB or ENTER and $some_var would be completed (possibly need to type more letters or select what I actually want if others matched the first few characters...)



With all this editor can do I'm BLOWN away this isn't something that works right out of the box!? really makes me wonder if maybe I am missing something...obviously it prevents errors/typos...not to mention the time saved just typing.



Anyways, here's what I've done:



On the welcome screen there's common options for "what I do" I used the php and javascript options; no keybindings



I then started to install several other extensions that looked promising from youtubers, and at some point noticed this issue...



I uninstalled ALL extensions and just picked the PHP option, no dice.



So then I started adding several "PHP ________" extensions, including; IntelliSense, Intelephense, Autocomplete, etc... ONE-BY-ONE and uninstalling if it didn't work, just in case there was a conflict - still no luck (obviously).



What am I missing guys!? I have not seen anyone else asking about this...I hope I'm just over-complicating it and there's something simple I've overlooked...



THANKS.




For what it's worth:



If I open the test file in a browser and echo the included variables, they're there.



I'm running Mint xfce, with LAMP:



php -v
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


My settings.json has a couple custom things I've added/tried along the way:



// PHP TROUBLESHOOTINGS:
//"files.associations": "*.php": "html",
"files.autoGuessEncoding": true,
"files.defaultLanguage": "php",
"php.suggest.basic": true,

"editor.quickSuggestions":
"other": true,
"comments": true,
"strings": true
,









share|improve this question
















I have just jumped on the Visual Studio Code bandwagon, but have hit my first deal-breaker: I can't get it to autocomplete variables that I've set inside of an included "config.php" file, where I would set variables like:



$some_var = 'something';


Then in another file I would include:



<?php
include 'config.php';

// etc.......


Then, in this file I should be able to start typing $som and hit TAB or ENTER and $some_var would be completed (possibly need to type more letters or select what I actually want if others matched the first few characters...)



With all this editor can do I'm BLOWN away this isn't something that works right out of the box!? really makes me wonder if maybe I am missing something...obviously it prevents errors/typos...not to mention the time saved just typing.



Anyways, here's what I've done:



On the welcome screen there's common options for "what I do" I used the php and javascript options; no keybindings



I then started to install several other extensions that looked promising from youtubers, and at some point noticed this issue...



I uninstalled ALL extensions and just picked the PHP option, no dice.



So then I started adding several "PHP ________" extensions, including; IntelliSense, Intelephense, Autocomplete, etc... ONE-BY-ONE and uninstalling if it didn't work, just in case there was a conflict - still no luck (obviously).



What am I missing guys!? I have not seen anyone else asking about this...I hope I'm just over-complicating it and there's something simple I've overlooked...



THANKS.




For what it's worth:



If I open the test file in a browser and echo the included variables, they're there.



I'm running Mint xfce, with LAMP:



php -v
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies


My settings.json has a couple custom things I've added/tried along the way:



// PHP TROUBLESHOOTINGS:
//"files.associations": "*.php": "html",
"files.autoGuessEncoding": true,
"files.defaultLanguage": "php",
"php.suggest.basic": true,

"editor.quickSuggestions":
"other": true,
"comments": true,
"strings": true
,






php visual-studio-code vscode-settings






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 0:29









Gama11

12.3k52551




12.3k52551










asked Mar 7 at 13:06









TheFirstMinuteTheFirstMinute

114




114












  • Is this even a feature? I know it picks up functions but unsure about variables.

    – Script47
    Mar 7 at 13:09











  • It does work with PHP Intellisense - Crane on my visual code. However on first install it doens't always work instantly. I guess this is an index problem..

    – Wimanicesir
    Mar 7 at 13:32











  • Thanks, funny enough PHP Intellisense - Crane is the last one I installed, and is still installed...I just closed out and restarted, nope. As for if it's a feature - I can't imagine it isn't at least an extension...I've been using Dreamweaver for over a decade and it does it. I also have Geany installed, and even it does it. Definitely a feature I think is a must have.

    – TheFirstMinute
    Mar 7 at 15:11


















  • Is this even a feature? I know it picks up functions but unsure about variables.

    – Script47
    Mar 7 at 13:09











  • It does work with PHP Intellisense - Crane on my visual code. However on first install it doens't always work instantly. I guess this is an index problem..

    – Wimanicesir
    Mar 7 at 13:32











  • Thanks, funny enough PHP Intellisense - Crane is the last one I installed, and is still installed...I just closed out and restarted, nope. As for if it's a feature - I can't imagine it isn't at least an extension...I've been using Dreamweaver for over a decade and it does it. I also have Geany installed, and even it does it. Definitely a feature I think is a must have.

    – TheFirstMinute
    Mar 7 at 15:11

















Is this even a feature? I know it picks up functions but unsure about variables.

– Script47
Mar 7 at 13:09





Is this even a feature? I know it picks up functions but unsure about variables.

– Script47
Mar 7 at 13:09













It does work with PHP Intellisense - Crane on my visual code. However on first install it doens't always work instantly. I guess this is an index problem..

– Wimanicesir
Mar 7 at 13:32





It does work with PHP Intellisense - Crane on my visual code. However on first install it doens't always work instantly. I guess this is an index problem..

– Wimanicesir
Mar 7 at 13:32













Thanks, funny enough PHP Intellisense - Crane is the last one I installed, and is still installed...I just closed out and restarted, nope. As for if it's a feature - I can't imagine it isn't at least an extension...I've been using Dreamweaver for over a decade and it does it. I also have Geany installed, and even it does it. Definitely a feature I think is a must have.

– TheFirstMinute
Mar 7 at 15:11






Thanks, funny enough PHP Intellisense - Crane is the last one I installed, and is still installed...I just closed out and restarted, nope. As for if it's a feature - I can't imagine it isn't at least an extension...I've been using Dreamweaver for over a decade and it does it. I also have Geany installed, and even it does it. Definitely a feature I think is a must have.

– TheFirstMinute
Mar 7 at 15:11













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55044530%2fvs-code-php-no-autocomplete-for-variables-from-included-files%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55044530%2fvs-code-php-no-autocomplete-for-variables-from-included-files%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко