Repository navigation
Closed
Labels
feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitieslanguages-basicBasic language support issuesphpPHP support issues
Milestone
Description
In PHP files there is no html tags auto completion, please add.
EDIT 9/13/2018 Erich Gamma (@egamma): VS Code provides only basic support for PHP, but there are powerful PHP extensions available in the market place:
This feature should be provided by these extensions (Intelephence actually already does support it). Please give these extensions a try and help to make them better by filing issues and pull requests.
This issue has lost focus and turned into a discussion whether VS Code should provide PHP support out of box. However, as with many other language like C#, C++, Go, Python, Rust we do not want to bundle PHP with VS Code but rather rely on our great extension ecosystem. I´m therefore closing this issue.
Reacted by luxzg, Leo Decking, Andreas Bjørn Hassing, Mike, BenjaVR, Hunter Mitchell, Johannes Meyer, Hernan da Silva, Corentin Girard, Rafael Garcia Lepper and 190 more
Reacted by agro, Augustinas Venclovas, _or_75, Georgi Kirilov, nullcore, Alexandre Elshobokshy and AivarasAS
Reacted by Dinesh Khadka Lakai, Ivan Gretsky, MunMunMiao, 1011X1011, Mark Carpenter Jr, YaneonY, Thomas Andre Karlsen, Shawn X, Ken Newman, Ahmad Syafrudin and 6 more
Reacted by Dinesh Khadka Lakai, YaneonY, Nato Boram, Stefano Tonanni, _or_75 and Gibran Malheiros
Reacted by Dinesh Khadka Lakai, pruebasuburfa, Bruce Brophy, MunMunMiao, 1011X1011, Martin Schwenzer, YaneonY, Ken Newman, Manuel Luciani, Georgi Kirilov and 8 more
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitieslanguages-basicBasic language support issuesphpPHP support issues
Activity
Tyriar commentedon Nov 26, 2015
Sounds reasonable. The HTML tag intellisense providers are located here, it might just be a matter of hooking that module up to the PHP code. Also insuring they are only available when outside
<?phptags, if I remember how PHP works correctly.Tyriar commentedon Nov 26, 2015
Outside
<?php ?>is HTML, inside is PHP. So the HTML auto complete should only be available outside the<?php ?>tags.[-]No html tags auto completion[/-][+][php] Provide html intellisense[/+]osjn commentedon Dec 7, 2015
Please add this feature quickly, I think it's a basic feature, thank you guys.
egamma commentedon Dec 8, 2015
Jingnen (@osjn) thanks for helping us with the prioritization by commenting. An even better way to help us would be a Pull Request with an implementation.
TheColorRed commentedon Mar 4, 2016
Maybe it is just me, but I think it would be cool if intellisense was available inside of php strings as well.
frankmuts commentedon Mar 9, 2016
An upvote from me too. This feature is needed, please.
215 remaining items
TheDutchCoder commentedon Aug 13, 2018
This is a 3 year old issue and it will never get resolved is my feeling.
This is such a basic thing to have in an editor and it's making my day-to-day work incredibly annoying.
I'll probably have to switch back to ST3, because I feel like VScode, especially lately, has been moving backwards by adding all kinds of fancy features but ignoring their core problems.
steebchen commentedon Aug 17, 2018
Reinier Kaper (@TheDutchCoder) It's because nobody wants to code PHP these days, which is the right thing to do. :D
benyaminl commentedon Aug 17, 2018
@steebcheen please keep on the topic. Thanks
benyaminl commentedon Aug 18, 2018
Daniel Imms (@Tyriar) Anyway does anyone have been assigned for this? Or it's not?
EDIT: Oh It's assigned.. Okay
thanasisHS commentedon Aug 30, 2018
Reilly Lowery (@RiFi2k) Hello and thanks for trying to help! I tried your extension but it doesn't work. I tried the settings that you provided, but still no dice. Maybe it depends on the php formatter in use? What extension do you suggest to use to enable php formatting in the first place?
OK, quick update: It works on save, which is great! It doesn't work with the right click context menu. I guess it's a fair compromise :)
ThemeCSS commentedon Sep 12, 2018
I thought the issue is only in my preference. When I mixed the HTML code to php the format is really messy like when I hit tab it will tab size to 4 and then add a new one now tab size is 2. I'd like to switch from ST3 to VSC but this stops me from switching to VSC. I guess I have to stay on ST3 for now.
RiFi2k commentedon Sep 12, 2018
thanasisHS Sorry just saw this.
My extension will only run if format on save is configured, and it doesn't run as an actual PHP formatter, runs onBeforeSave.
I pretty much published my whole config as a few gists, feel free it took me months of work to get it perfect. For formatting I use PHPCBF but use this one, I know it only has 300 installs but he updated and merged the code from all the dead phpcbf extensions, it's money.
https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpcbf
Here are my gists, if anyone else is interested too in my config. It does php, js, scss, css, vue - auto formatting and linting with eslint, stylelint, phpcbf, phpcs, prettier. It's a beat once you get it all set up.
Global
https://gist.github.com/RiFi2k/d43e84788b1798252f30cac28b6f6eda
Project
https://gist.github.com/RiFi2k/42e294f3785bdbbc2641c4b18955e16f
All the dotfiles, composer.json, package.json, php ruleset
https://gist.github.com/RiFi2k/8b753d1f12a36760f3ee6e1322daf708
egamma commentedon Sep 13, 2018
Closing this issue. I´ve explained the reason in the description of the issue above.
jens1o commentedon Sep 13, 2018
thanks. Code is getting more ruined each day. I thought you at Microsoft were cool with all this FOSS-initative, but it is still not independent, but focused to make money by advertising Github and Azure.
egamma commentedon Sep 13, 2018
Jens Hausdorf (@jens1o) I´m confused, this decision is all about fostering the OSS ecosystem. The referenced extensions are OSS projects, please help to make them better. The resources of the VS Code team are not unlimited.
Also, please do not forget our Code of Conduct and let´s communicate in a respectful way.
jens1o commentedon Sep 13, 2018
I just don't understand why you prioritize tasks over other, although the community definitely wants those. I only hear "issue reduction" and "out of scope", and, oh yeah, "limited resources"(that's why the community is here, lol). Nobody complains about things not coming soon, but a little bit more focus on the needs of the community would definitely help. Why do we need to keep the issue number low, even though they don't pollute anything? In my eyes, the Code roadmap passed the sweet spot 2 iterations ago. Now, it is all about earning money(with the big community earned throughout the years; I'm using it since the first demo of
Build();everyday) by integrating paid and third-party products(like GitHub, owned by Microsoft).I'm saying that I'm not feeling welcome in this community anymore(and I'm honestly disappointed), I don't attack you personal in any way, so there is no reason to reference the COC here. It is part of FOSS-software to have open discussions.
But speaking of COC, I'd quote this:
I don't get why you want to shut me down, only because I disagree with the politics you do.
I'm trying to understand why you changed your politics, so could you please elaborate?
popcorner commentedon Sep 13, 2018
Erich Gamma (@egamma) I don't think that your reason for closing this issue is reasonable. I understand that visual studio code can't and shouldn't provide all the features out of the box, but HTML support for PHP language should be one of the most basic feature for a PHP editor. Maybe most of the features for PHP should be provided by extensions, but this one shouldn't. Lots of editors have this feature, even the simple text editor, Notepad++, have this feature. This is part of the basic PHP grammar, and you can't write PHP without it. An editor shouldn't say that it supports PHP without this feature, for it can't read PHP in the right way.
And why does Javascript in HTML file works well and CSS in HTML works well without any extension in vscode? It seems that vscode have this feature but don't want to make a similar one for PHP, That's unfair.
This feature is really important for PHP users, and most user won't try to search these issues and they know nothing about the extensions which can help them get these basic and necessary features. These users may simply download this editor, install it and find this "bug", then uninstall it immediately and get a very bad impression about vscode. They won't say anything here. All the users who want to share their opinions here are the people who really want vscode to be better. The feeling for writing PHP code without this funtion is really too painful, you can't tell the blocks apart, you have to count the html tags manually, or convert the file format from php to html, and from html to php many times. All the other languages I have ever tried on the vscode won't have such bad feelings without any extension installed. Users won't know the reason, they just care about the user experience. Please consider about this and do something, even adding a little bit highlight is good too:
RiFi2k commentedon Sep 13, 2018
Agreed, popcorner (@popcorner) is correct this is essential for PHP devs and considering WordPress powers ~30% of the internet or more and pretty much every theme or plugin has PHP nested with HTML in every template file. So basically a ridiculous amount of users right there in need of this.
Now I actually think the core of this whole issue lies with the fact you can not register multiple formatting extensions at the same time. There is basically kind of a race on that hook and only one can win, plus you can't see as a user what is trying to run when, and which one actually ran. So for a PHP file, odiously your going to go with a formatting extension that does PHP code over HTML. But if you could chain formatting extensions and there was a hook order or something that was changeable then you could register a PHP and an HTML and then set the priority / order for one to run first / last. For example this whole issue is fixed if you can...
Step One run PHPCBF or similar PHP formatting extension.
Step Two run js-beautify html formatting which just skips over all the PHP anyways and does the HTML only, which is the exact same thing I do in my extension, Format HTML in PHP, to fix the problem. But I have to run it onBeforeSave instead of using the default formatting registration, but this shouldn't have to be the solution.
So to sum it up, it's very needed, but instead of fixing / not fixing the issue, why not explore my idea above and then you end up having a way better experience with every language and formatting, for users and extension developers.