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

use language server for onEnterRules #57968

Closed
kyle-rb opened this issue Sep 5, 2018 · 2 comments
Closed

use language server for onEnterRules #57968

kyle-rb opened this issue Sep 5, 2018 · 2 comments
Assignees
Labels
editor-autoindent Editor auto indentation issues feature-request Request for new features or functionality
Milestone

Comments

@kyle-rb
Copy link

kyle-rb commented Sep 5, 2018

Issue Type: Bug

  1. Create a pair of opening and closing tags, e.g. <div></div>
  2. Type some text in between those tags, with part of it embedded in another tag, e.g. <div>some <em>text</em> here</div>
  3. With the cursor just before the outer closing tag (in this case </div>), press enter
  4. A newline is created normally, with the closing tag indented to the same level as the opening tag

The expected behavior is for the closing tag to be indented two lines, and for the cursor to be in the line between the opening and closing tags, indented a level past them. This can be observed when the same steps are followed, except no additional tag is embedded in step 2, just normal text.

Note: this issue occurs commonly for me when using Emmet to type nested lists (many <li> and <ul> tags).

VS Code version: Code 1.26.1 (493869e, 2018-08-16T18:31:26.156Z)
OS version: Darwin x64 16.7.0

@vscodebot vscodebot bot added editor editor-autoindent Editor auto indentation issues labels Sep 5, 2018
@aeschli
Copy link
Contributor

aeschli commented Sep 12, 2018

I see what you mean. You want auto-indentation to work with more content on the line
The problem is that the indent-onEnter feature is based on a regular expressions that matches at the text just before the cursor. It's difficult (impossible?) to write a regular expression that also correctly handles text in between containing closed tags.

The solution would probably be to use the language server for indent on enter..

@microsoft microsoft deleted a comment from vscodebot bot Sep 12, 2018
@aeschli aeschli changed the title Identation inside existing tag broken use language server for onEnterRules Sep 12, 2018
@aeschli aeschli added the feature-request Request for new features or functionality label Sep 12, 2018
@aeschli aeschli added this to the Backlog milestone Sep 12, 2018
@aeschli
Copy link
Contributor

aeschli commented Jan 8, 2019

duplicate of #63097

@aeschli aeschli closed this as completed Jan 8, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-autoindent Editor auto indentation issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants