Skip to content

Commit

Permalink
fix(folding): correct handling of file references in DevInFileReferen…
Browse files Browse the repository at this point in the history
…ceFoldingBuilder.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.
  • Loading branch information
phodal committed Mar 14, 2024
1 parent b6c960e commit ca240d1
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ class DevInFileReferenceFoldingBuilder : FoldingBuilderEx() {
if (element.elementType == DevInTypes.PROPERTY_VALUE) {
val agentId = element.parent?.findElementAt(1)?.text
if (agentId == "file" && element.text.contains("/")) {
descriptors.add(
FoldingDescriptor(element.node, element.textRange, null, emptySet(), true)
)
descriptors.add(FoldingDescriptor(element.node, element.textRange))
}
}

Expand Down

0 comments on commit ca240d1

Please sign in to comment.