Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing tab in a PHP file inserts an XML tag #7913

Closed
nevadascout opened this issue Jun 21, 2016 · 16 comments
Closed

Pressing tab in a PHP file inserts an XML tag #7913

nevadascout opened this issue Jun 21, 2016 · 16 comments
Assignees
Labels
php PHP support issues

Comments

@nevadascout
Copy link

nevadascout commented Jun 21, 2016

  • VSCode Version: 1.2.1
  • OS Version: OS X 10.11.5

Steps to Reproduce:

  1. Type a variable in a PHP file
  2. Put your cursor at the end of the variable
  3. Press tab

php-tab-xml

@mrqtsfr
Copy link

mrqtsfr commented Jun 21, 2016

Same in:

VSCode Version: 1.2.1
OS Version: Windows 10

@dbaeumer dbaeumer added the php PHP support issues label Jun 22, 2016
@dbaeumer
Copy link
Member

@aeschli do you know of anything special we are doing here?

@aeschli
Copy link
Contributor

aeschli commented Jun 23, 2016

It's emmet.

@aeschli aeschli assigned egamma and unassigned aeschli Jun 23, 2016
@mrmlnc
Copy link
Contributor

mrmlnc commented Aug 26, 2016

@egamma,

Maybe do as plugin for Sublime Text?

disable_tab_abbreviations_for_scopes — a comma-separated list of syntax scopes where Tab key handler should be disabled. For example, if you want disable handler inside strings of programming languages and HAML syntax, your setting will look like this:

"disable_tab_abbreviations_for_scopes": "text.haml, string"

https://github.com/sergeche/emmet-sublime#tab-key-handler

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 12, 2016

Yes, this is emmet (same problem as #13578). To disable this behavior, add the following setting:

"emmet.excludeLanguages": ["php"]

@mjbvz mjbvz closed this as completed Nov 12, 2016
@mjbvz mjbvz reopened this Nov 16, 2016
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 16, 2016

Looks like php is still acting up. The above approach works for 'markdown' and other emmet enabled languages but after adding "php" to emmet.excludeLanguages, I'm still seeing this behavior

@ramya-rao-a
Copy link
Contributor

From @zackote

  1. Open file with syntax set to php.
  2. Type php, and press Tab to expand with Emmet

Expanding the string php with Emmet produces <php></php> instead of the far more helpful <?php ?>. I believe Sublime, Atom, etc. all address this and the <?php ?> expansion occurs.

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 16, 2016

Well, confirm, emmet.excludeLanguages with php value does not work any more 😢

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Nov 16, 2016

@mrmlnc You mentioned here #12325 (comment) that emmet should work for PHP in VS Code now.
Did you mean that xml expansion works in php files or php expansions should work in php files?

Meaning, should this>Form>data.Encode expand to $this->Form->data['Encore'] and not

<this>
    <Form>
        <data class="Encode"></data>
    </Form>
</this>

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 16, 2016

I mean, that when I point out php in emmet.excludeLanguages Emmet continues to work in php.

2016-11-17_01-43-48

But if I point out html Emmet doest now work:

2016-11-17_01-44-48

Something broke. I'll take a look today or tomorrow.

@ramya-rao-a
Copy link
Contributor

@mjbvz just found that the exclusion works if you are inside the block.

@ramya-rao-a
Copy link
Contributor

@mrmlnc At the moment php is not one of the supported modes for emmet correct?

As in I cannot expect this>Form>data.Encode to expand to $this->Form->data['Encore']

@mjbvz
Copy link
Collaborator

mjbvz commented Nov 16, 2016

Yes, I did actually test this before closing this the other day :) but forgot that adding "php" to excluded languages only disables emmet inside of <?php?> blocks, and not within the whole file:

nov-16-2016 14-49-11

Closing this again

@mjbvz mjbvz closed this as completed Nov 16, 2016
@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 16, 2016

just found that the exclusion works if you are inside the block.

Yes, you right. I think that sooner VS Code defined region differently (at least when we worked on this with Erich). Sorry. If I press Tab inside <?php ?> this works correctly.

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 16, 2016

At the moment php is not one of the supported modes for emmet correct?

My apologies again. Now VS Code determines scopes of languages a little differently.

As in I cannot expect this>Form>data.Encode to expand to $this->Form->data['Encore']

As far as I know, Emmet does not work with PHP. Because Emmet has no code for this (https://github.com/emmetio/emmet/search?utf8=%E2%9C%93&q=php) 😄.

@ramya-rao-a
Copy link
Contributor

Thanks @mrmlnc

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
php PHP support issues
Projects
None yet
Development

No branches or pull requests

8 participants