File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
main/java/ch/usi/si/seart/treesitter
test/java/ch/usi/si/seart/treesitter Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 101101 <artifactId >commons-collections4</artifactId >
102102 <version >4.4</version >
103103 </dependency >
104+ <dependency >
105+ <groupId >commons-io</groupId >
106+ <artifactId >commons-io</artifactId >
107+ <version >2.15.0</version >
108+ </dependency >
104109 <dependency >
105110 <groupId >org.projectlombok</groupId >
106111 <artifactId >lombok</artifactId >
Original file line number Diff line number Diff line change 55import lombok .Generated ;
66import lombok .Getter ;
77import lombok .experimental .FieldDefaults ;
8+ import org .apache .commons .io .FilenameUtils ;
89import org .jetbrains .annotations .NotNull ;
910import org .jetbrains .annotations .TestOnly ;
1011
@@ -459,8 +460,8 @@ public static void validate(@NotNull Language language) {
459460 "Path argument must not be a directory!"
460461 );
461462 String name = path .getFileName ().toString ();
462- int i = name . lastIndexOf ( '.' );
463- return Optional .ofNullable ( i > 0 ? name . substring ( i + 1 ) : null )
463+ String extension = FilenameUtils . getExtension ( name );
464+ return Optional .of ( extension )
464465 .map (EXTENSION_LOOKUP ::get )
465466 .orElseGet (Collections ::emptyList );
466467 }
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ private static class AssociatedWithProvider implements ArgumentsProvider {
5959 public Stream <? extends Arguments > provideArguments (ExtensionContext extensionContext ) {
6060 return Stream .of (
6161 Arguments .of ("requirements.txt" , List .of ()),
62+ Arguments .of (".py" , List .of (Language .PYTHON )),
6263 Arguments .of ("__init__.py" , List .of (Language .PYTHON )),
6364 Arguments .of ("Main.java" , List .of (Language .JAVA )),
6465 Arguments .of ("example.h" , List .of (
You can’t perform that action at this time.
0 commit comments