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

Explore options to speed up Emmet abbreviation expansion in larger files #43470

Closed
ramya-rao-a opened this issue Feb 12, 2018 · 2 comments
Closed
Assignees
Labels
debt Code quality issues emmet Emmet related issues
Milestone

Comments

@ramya-rao-a
Copy link
Contributor

Currently we use the emmet modules html-matcher and css-parser to parse html,css,less,scss files to determine whether or not current position is a valid location to expand emmet abbreviation. Cons of this approach are

  • The parsers are slow when it comes to large files
  • The parsers are not tolerant for incomplete files.

The parsers used in the html and css extensions on the other hand are faster and more accurate

@ramya-rao-a ramya-rao-a added debt Code quality issues emmet Emmet related issues labels Feb 12, 2018
@ramya-rao-a ramya-rao-a added this to the February 2018 milestone Feb 12, 2018
@ramya-rao-a ramya-rao-a self-assigned this Feb 12, 2018
@ramya-rao-a ramya-rao-a modified the milestones: February 2018, March 2018 Feb 23, 2018
@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented Mar 27, 2018

In common cases, like having html emmet completions in ts/js files, use of html parser will not help. So we will continue to use the parsing logic we have at the moment where we traverse backwards (atmost 500 characters) from current position to decide if we are inside an open or close tag.

Due to the css language service having issues with parsing incomplete files (See microsoft/vscode-css-languageservice#81 and microsoft/vscode-css-languageservice#69), we wont be using the parsers from the css language service.

For stylesheets, we are resolving to do a partial parsing of the content around the cursor to determine if emmet completions would be valid or not. See 91416ff and f5b569b

What's pending is tests for the same.

@ramya-rao-a
Copy link
Contributor Author

Tests are done with #46977

@ramya-rao-a ramya-rao-a modified the milestones: April 2018, March 2018 Mar 30, 2018
@ramya-rao-a ramya-rao-a changed the title Replace emmet parser with the one from html/css language service when expanding abbreviation Explore options to speed up Emmet abbreviation expansion in larger files Apr 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 14, 2018
@vscodebot vscodebot bot unassigned gushuro May 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues emmet Emmet related issues
Projects
None yet
Development

No branches or pull requests

3 participants