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

Add cache, update several Emmet commands #112597

Merged
merged 6 commits into from
Dec 16, 2020
Merged

Add cache, update several Emmet commands #112597

merged 6 commits into from
Dec 16, 2020

Conversation

rzhao271
Copy link
Contributor

@rzhao271 rzhao271 commented Dec 15, 2020

This PR fixes #99896 and affects #71996 and #110577

@rzhao271
Copy link
Contributor Author

rzhao271 commented Dec 15, 2020

This PR also fixes #89821

@aeschli
Copy link
Contributor

aeschli commented Dec 16, 2020

I glanced over it and it looks good!

@aeschli aeschli self-requested a review December 16, 2020 08:47

// If no closing tag or cursor is between open and close tag, then no-op
if (!currentNode.close || (position.isAfter(currentNode.open.end) && position.isBefore(currentNode.close.start))) {
if (!currentNode?.endTagStart
Copy link
Contributor

@aeschli aeschli Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentNode is defined here, so the '?' can be removed.
0 is a valid offset, admittedly not possible for the tagStart. So better currentNode.endTagStart === undefined

@@ -145,6 +146,14 @@ export function activateEmmetExtension(context: vscode.ExtensionContext) {
updateEmmetExtensionsPath(true);
}
}));

context.subscriptions.push(vscode.workspace.onDidOpenTextDocument((e) => {
addFileToParseCache(toLSTextDocument(e));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found addFileToParseCache confusing. Looking at the implementation, it set and entry with undefined to the cache. Is that necessary? it's done for all URI, regardless if html or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I should make it only save markup files like HTML or XML

@rzhao271 rzhao271 merged commit 483bd40 into master Dec 16, 2020
@rzhao271 rzhao271 deleted the rzhao271/cache-test branch December 16, 2020 18:21
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants