Skip to content

Commit

Permalink
fix: expand selection broken
Browse files Browse the repository at this point in the history
close #1085
  • Loading branch information
johnsoncodehk committed Mar 21, 2022
1 parent 9dd9a08 commit ed75138
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -13,11 +13,11 @@ export function register(context: DocumentServiceRuntimeContext) {
context,
document,
positions,
sourceMap => true,
sourceMap => sourceMap.embeddedFile.capabilities.foldingRanges,
(positions, sourceMap) => [positions
.map(position => sourceMap.getMappedRange(position, position, data => !!data.capabilities.basic)?.[0].start)
.map(position => sourceMap.getMappedRange(position, position)?.[0].start)
.filter(shared.notEmpty)],
(plugin, document, positions) => plugin.getSelectionRanges?.(document, positions),
(plugin, document, positions) => positions.length ? plugin.getSelectionRanges?.(document, positions) : undefined,
(data, sourceMap) => transformSelectionRanges(
data,
range => {
Expand All @@ -28,7 +28,6 @@ export function register(context: DocumentServiceRuntimeContext) {
return sourceMap.getSourceRange(range.start, range.end)?.[0]
},
),
arr => arr.flat(),
);
}
}

0 comments on commit ed75138

Please sign in to comment.