-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Conversation
82dd0c4
to
f3bb417
Compare
This PR also fixes #89821 |
f3bb417
to
58215fc
Compare
3020e6a
to
5da75aa
Compare
I glanced over it and it looks good! |
extensions/emmet/src/matchTag.ts
Outdated
|
||
// 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 |
There was a problem hiding this comment.
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
extensions/emmet/src/emmetCommon.ts
Outdated
@@ -145,6 +146,14 @@ export function activateEmmetExtension(context: vscode.ExtensionContext) { | |||
updateEmmetExtensionsPath(true); | |||
} | |||
})); | |||
|
|||
context.subscriptions.push(vscode.workspace.onDidOpenTextDocument((e) => { | |||
addFileToParseCache(toLSTextDocument(e)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
- Explicitly use undefined in if statements to avoid if (0) - Add only markup files to cache - Do not push to stack for balanceOut if newSelection same as original
100dc52
to
98f7cf1
Compare
This PR fixes #99896 and affects #71996 and #110577