Skip to content

Commit ca240d1

Browse files
committed
fix(folding): correct handling of file references in DevInFileReferenceFoldingBuilder.kt #101
The commit corrects an issue where file references were not being properly folded when the property value contained a slash ('/') character. Previously, the folding descriptor was being unnecessarily constructed with an empty set of additional ranges and a boolean value indicating that the folding should be forced, which was not the intended behavior. The commit simplifies the code by removing these unnecessary parameters, ensuring that the folding descriptor is constructed correctly for file references.
1 parent b6c960e commit ca240d1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

exts/devin-lang/src/main/kotlin/cc/unitmesh/devti/language/folding/DevInFileReferenceFoldingBuilder.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class DevInFileReferenceFoldingBuilder : FoldingBuilderEx() {
2525
if (element.elementType == DevInTypes.PROPERTY_VALUE) {
2626
val agentId = element.parent?.findElementAt(1)?.text
2727
if (agentId == "file" && element.text.contains("/")) {
28-
descriptors.add(
29-
FoldingDescriptor(element.node, element.textRange, null, emptySet(), true)
30-
)
28+
descriptors.add(FoldingDescriptor(element.node, element.textRange))
3129
}
3230
}
3331

0 commit comments

Comments
 (0)