Skip to content

[php] Provide html intellisense #670

Closed

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.

Activity

  1. Tyriar commented on Nov 26, 2015

    @Tyriar
    Contributor

    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 <?php tags, if I remember how PHP works correctly.

  2. Tyriar commented on Nov 26, 2015

    @Tyriar
    Contributor

    Outside <?php ?> is HTML, inside is PHP. So the HTML auto complete should only be available outside the <?php ?> tags.

  3. added
    feature-request
    on Nov 27, 2015
  4. changed the title [-]No html tags auto completion[/-] [+][php] Provide html intellisense[/+] on Nov 27, 2015
  5. added
    languages-basic
    on Nov 30, 2015
  6. osjn commented on Dec 7, 2015

    @osjn

    Please add this feature quickly, I think it's a basic feature, thank you guys.

  7. egamma commented on Dec 8, 2015

    @egamma
    Member

    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.

  8. TheColorRed commented on Mar 4, 2016

    @TheColorRed

    Maybe it is just me, but I think it would be cool if intellisense was available inside of php strings as well.

  9. frankmuts commented on Mar 9, 2016

    @frankmuts

    An upvote from me too. This feature is needed, please.

  10. added
    help wanted
    on Mar 9, 2016
  11. 215 remaining items

  12. TheDutchCoder commented on Aug 13, 2018

    @TheDutchCoder

    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.

  13. steebchen commented on Aug 17, 2018

    @steebchen

    Reinier Kaper (@TheDutchCoder) It's because nobody wants to code PHP these days, which is the right thing to do. :D

  14. benyaminl commented on Aug 17, 2018

    @benyaminl

    @steebcheen please keep on the topic. Thanks

  15. benyaminl commented on Aug 18, 2018

    @benyaminl

    Daniel Imms (@Tyriar) Anyway does anyone have been assigned for this? Or it's not?
    EDIT: Oh It's assigned.. Okay

  16. thanasisHS commented on Aug 30, 2018

    @thanasisHS

    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 :)

  17. ThemeCSS commented on Sep 12, 2018

    @ThemeCSS

    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.

  18. RiFi2k commented on Sep 12, 2018

    @RiFi2k

    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

  19. egamma commented on Sep 13, 2018

    @egamma
    Member

    Closing this issue. I´ve explained the reason in the description of the issue above.

  20. jens1o commented on Sep 13, 2018

    @jens1o
    Contributor

    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.

  21. egamma commented on Sep 13, 2018

    @egamma
    Member

    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.

  22. jens1o commented on Sep 13, 2018

    @jens1o
    Contributor

    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:

    Understand disagreements

    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?

  23. popcorner commented on Sep 13, 2018

    @popcorner

    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:

    • provide some basic support for HTML, or
    • provide an official extension with this feature and install automatically when using PHP
    • or even a simple recommedation for all the PHP user and install the recommended extension with one click, then get this feature and make vscode be able to really support PHP
  24. RiFi2k commented on Sep 13, 2018

    @RiFi2k

    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.

  25. locked and limited conversation to collaborators on Oct 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature-requesthelp wantedlanguages-basicphp

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions