Skip to content

Commit

Permalink
fix: cannot unwrap parenthesized expression for export assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Oct 9, 2022
1 parent 497cafc commit 8ea5136
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -21,8 +21,8 @@ export function parseScriptRanges(ts: typeof import('typescript/lib/tsserverlibr

if (ts.isExportAssignment(raw)) {

let node: ts.AsExpression | ts.ExportAssignment = raw;
while (ts.isAsExpression(node.expression)) { // fix https://github.com/johnsoncodehk/volar/issues/1882
let node: ts.AsExpression | ts.ExportAssignment | ts.ParenthesizedExpression = raw;
while (ts.isAsExpression(node.expression) || ts.isParenthesizedExpression(node.expression)) { // fix https://github.com/johnsoncodehk/volar/issues/1882
node = node.expression;
}

Expand Down

0 comments on commit 8ea5136

Please sign in to comment.