Skip to content

Commit

Permalink
Check specifically the singleton path segments
Browse files Browse the repository at this point in the history
  • Loading branch information
gimantha committed Dec 2, 2024
1 parent 90d4c28 commit c49bac6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4088,8 +4088,9 @@ public void visit(BLangInvocation.BLangResourceAccessInvocation resourceAccessIn
return;
} else if (targetResourceFuncCount > 1) {
//Filter the resource function with identifier segment
Optional<BResourceFunction> first = resourceFunctions.stream().filter(func -> func.pathSegmentSymbols
.get(func.pathSegmentSymbols.size() - 1).kind == SymbolKind.RESOURCE_PATH_IDENTIFIER_SEGMENT)
Optional<BResourceFunction> first = resourceFunctions
.stream().filter(func -> func.pathSegmentSymbols.stream()
.allMatch(segment -> segment.kind == SymbolKind.RESOURCE_PATH_IDENTIFIER_SEGMENT))
.findFirst();
if (first.isPresent()) {
resourceFunctions = new ArrayList<>(List.of(first.get()));
Expand Down

0 comments on commit c49bac6

Please # to comment.