Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra debug info for the KLSP #3872

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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