From 47e31ed420fb1242dfa34c24daf80116a33bd55e Mon Sep 17 00:00:00 2001 From: Nick Battle Date: Tue, 28 Nov 2023 15:33:00 +0000 Subject: [PATCH] Sort files in a directory when loading all files --- lsp/src/main/java/workspace/LSPWorkspaceManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lsp/src/main/java/workspace/LSPWorkspaceManager.java b/lsp/src/main/java/workspace/LSPWorkspaceManager.java index b8efcbcbb..056e21df9 100644 --- a/lsp/src/main/java/workspace/LSPWorkspaceManager.java +++ b/lsp/src/main/java/workspace/LSPWorkspaceManager.java @@ -38,6 +38,7 @@ import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.FileTime; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -421,6 +422,7 @@ private void loadProjectFiles(File root) throws IOException { FilenameFilter filter = getFilenameFilter(); File[] files = root.listFiles(); + Arrays.sort(files); // Predictable order List ignored = new Vector(); for (File file: files)