mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Fix detection of CSS Preprocessor Comments at Start of File in Emmet Extension (#146121)
* Fix for PartialStyleSheet getting stuck in loop Adds a clause for detecting `//` as a comment marker when working backwards through a file, preventing the parser from getting stuck when the comment starts at 1:1 * Modify change to detect start of file instead of skipping additional `/` characters now that we know the issue only occurs at offset 0. Co-authored-by: Tyler McEnaney <tharbakim@hotmail.com>
This commit is contained in:
@@ -226,7 +226,7 @@ export function parsePartialStylesheet(document: vscode.TextDocument, position:
|
||||
}
|
||||
|
||||
function consumeBlockCommentBackwards() {
|
||||
if (stream.peek() === slash) {
|
||||
if (!stream.sof() && stream.peek() === slash) {
|
||||
if (stream.backUp(1) === star) {
|
||||
stream.pos = findOpeningCommentBeforePosition(stream.pos) ?? startOffset;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user