mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
[folding] Cannot read property 'length' of undefined. Fixes #46171
This commit is contained in:
@@ -292,9 +292,9 @@ export function getJavascriptMode(documentRegions: LanguageModelCache<HTMLDocume
|
||||
let endLine = curr.end.line;
|
||||
if (startLine < endLine && startLine >= rangeStartLine && endLine < rangeEndLine) {
|
||||
let foldingRange: FoldingRange = { startLine, endLine };
|
||||
let match = document.getText(curr).match(/^\s*\/(\/\s*#(?:end)?region\b)|([\*\/])/);
|
||||
let match = document.getText(curr).match(/^\s*\/(?:(\/\s*#(?:end)?region\b)|(\*|\/))/);
|
||||
if (match) {
|
||||
foldingRange.type = match[1].length ? FoldingRangeType.Region : FoldingRangeType.Comment;
|
||||
foldingRange.type = match[1] ? FoldingRangeType.Region : FoldingRangeType.Comment;
|
||||
}
|
||||
ranges.push(foldingRange);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user