Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
devops committed Dec 13, 2023
2 parents b2be5c0 + a4e9877 commit 0e1b2cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public void findCacheFile() {
cacheFile =
Files.walk(Path.of(URI.create(workspaceFolder.getUri())))
.filter(p -> p.endsWith(CACHE_FILE_NAME))
.findFirst();
.min(Comparator.comparing(Path::getNameCount, Comparator.naturalOrder()));
clientLogger.logMessage("Found cache file: " + cacheFile);
loadCaches();
} catch (IOException e) {
clientLogger.logMessage("findCachesException: " + e);
Expand All @@ -81,7 +82,7 @@ public void loadCaches() {
// this way we can find all the updated locations when finding references
if (!files.containsKey(uri)) add(uri);
});
clientLogger.logMessage("loaded cached modules: " + caches.size());
clientLogger.logMessage("Loaded cached modules: " + caches.size());
}

public void add(String uri) {
Expand Down
3 changes: 2 additions & 1 deletion kernel/src/test/java/org/kframework/lsp/LSPTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -127,7 +128,7 @@ public void testKLSPathK() throws IOException {
Optional<Path> cacheFile =
Files.walk(Path.of(URI.create(workspaceFolder.getUri())))
.filter(p -> p.endsWith(Kompile.CACHE_FILE_NAME))
.findFirst();
.min(Comparator.comparing(Path::getNameCount, Comparator.naturalOrder()));
if (cacheFile.isPresent())
caches = loader.loadCache(java.util.Map.class, cacheFile.get().toFile());

Expand Down

0 comments on commit 0e1b2cd

Please sign in to comment.