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

enter inside html element doesn't add two lines with indented cursor in between #38101

Closed
amc123-glitch opened this issue Nov 11, 2017 · 11 comments
Assignees
Labels
editor-core Editor basic functionality info-needed Issue requires more information from poster

Comments

@amc123-glitch
Copy link

amc123-glitch commented Nov 11, 2017

  • VSCode Version: 1.18.0
  • OS Version: 10.13
  • Laravel Blade file

Steps to Reproduce:

  1. type any element -
  2. <p></p>
  3. hit enter

In most other editors if my cursor is inside of <p></p> and I hit enter, it will leave the <p> and then add a line with indent and then add a third line with the </p>

<p>
    (indented content)
</p>

My personal settings don't have anything on this but I am not sure if there is a user setting (what it would be referenced as.) Without this feature, I have to arrow up and over, hit enter again, and then hit tab to indent

@vscodebot vscodebot bot added new release editor-core Editor basic functionality labels Nov 11, 2017
@limbosounds
Copy link

As for me, now it's more comfortable despite of it's unusual

@amc123-glitch amc123-glitch changed the title enter inside html element doesn't add two lines with indent enter inside html element doesn't add two lines with indented cursor in between Nov 11, 2017
@amc123-glitch
Copy link
Author

@antony-chopin Not sure I understand your comment? At least for me all the other competing editors have the feature of when the cursor is in between the div, p, h1, etc tag they will add add an indented line for content and then push the closing tag underneath the indented line. Now I have mainly tested this in laravel blade files, but have noticed a plain html page does in fact add the indent.

@limbosounds
Copy link

@AnthonyMichaelc Yea, I'm about it. In my case, there is a lot of situations, when I need to add an extra wrapper for already existing group of tags (I'm React developer, so it's usual :D). Before I had to enter the wrapper, then select existing tags and press alt + arrow up to move lines into the wrapper. And I had to delete that extra line, which was not comfortable for me. Now it's nice for me that there is no extra line anymore. For me it's more easy to press enter 1 more time, than to remove extra line :)

@amc123-glitch
Copy link
Author

@antony-chopin That totally makes sense. I decided to contact the person who created the laravel blade syntax because it seems in my case blade syntax and vscode are not communicating properly. Cause for me I have to click enter twice then arrow up and hit tab which adds multiple steps that the other editors do in one click.

@limbosounds
Copy link

I suppose, the best way to solve this problem is to allow user to set up whether he wants to add additional line on enter or not.

@aeschli
Copy link
Contributor

aeschli commented Nov 13, 2017

What you describe is the default behaviour in VSCode for HTML files:
htmlenter

Is this for a different language mode, file this against the language extension (Laravel?).

@aeschli aeschli added info-needed Issue requires more information from poster and removed new release labels Nov 13, 2017
@amc123-glitch
Copy link
Author

Yes, after testing further into the issue I decided to contact the person who made the blade syntax extension. Sadly they have not looked at it.

@aeschli
Copy link
Contributor

aeschli commented Nov 14, 2017

Thanks, closing the issue then.

@aeschli aeschli closed this as completed Nov 14, 2017
@amc123-glitch
Copy link
Author

This issue may need to be reopened. I have contacted the team who is working on blade extension and everything they suggested is has not worked. More importantly I have tried every blade syntax extension in the marketstore.

Is it possible that there is an issue in vscode/the out of the box emmet extension processing php/blade syntax?

  • I have uninstalled all blade extensions and tested each one by one and got the same result
  • I tested Javascript, html, etc and they all work

When I search emmet in the market tab I do not see any extension there or anywhere to see if there is configurations that have changed, which could cause this issue with php frameworks. this is all the emmet configurations that are on my current install of vscode:

"emmet.syntaxProfiles": {
        "vue-html": "html",
        "vue": "html",
        "blade": "html"
    },
    "emmet.includeLanguages": {
        "vue-html": "html",
        "vue": "html",
        "blade": "html"
    },
    "emmet.triggerExpansionOnTab": true,
    "emmet.showAbbreviationSuggestions": true,
    "emmet.showExpandedAbbreviation": "always",

Unfortunately, this issue is making me and a good amount of the laravel/php people have to use other editors. Would like to get this working.

@limbosounds
Copy link

limbosounds commented Nov 20, 2017

@aeschli the behaviour displayed on GIF sometimes doesn't work in JSX files (thank God it doesn't :D)
When I trigger emmet: expand abbreviation for tag without a class (e. g. div), Enter includes an additional row (default behaviour). When I expand an abbreviation with className (e. g. div.my-awesome-class), Enter doesn't add an additional row (this behavior is more friendly for me)

@amc123-glitch
Copy link
Author

@antony-chopin I see that. For me, when I was working with jsx files I did not see a problem. Now i don't work with jsx files so I have removed the configuration for jsx. However, I am noticing with any blade syntax (which is lsrsvel/php) I am having this issue. I saw there was an issue similar to mine that has still not been resolved and they were saying that it may be an issue with vscode's handling of php and emmet and the indent. [ https://github.com/onecentlin/laravel-blade-snippets-vscode/issues/9 ].

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-core Editor basic functionality info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants