Skip to content

Commit

Permalink
Removed refreshBundleFile() as Angelo has another approach and the pr…
Browse files Browse the repository at this point in the history
…esence of that method is causing merge conflicts.
  • Loading branch information
SCWells72 committed Dec 10, 2024
1 parent de4ef90 commit 7e6e64a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
17 changes: 0 additions & 17 deletions src/main/java/com/redhat/devtools/lsp4ij/LSPIJUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1239,21 +1239,4 @@ public static String getProjectUri(Project project) {
.map(l -> new Location(l.getTargetUri(), l.getTargetSelectionRange() != null ? l.getTargetSelectionRange() : l.getTargetRange()))
.toList();
}

/**
* Forces the provided file that is bundled with LSP4IJ to refresh in VFS so that the latest version is used.
*
* @param bundledFile a file that is contained with the LSP4IJ distribution
*/
public static void refreshBundledFile(@NotNull VirtualFile bundledFile) {
// Refresh asynchronously then synchronously because otherwise bundled virtual files won't refresh properly
bundledFile.refresh(
true,
bundledFile.isDirectory(),
() -> bundledFile.refresh(
false,
bundledFile.isDirectory()
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider;
import com.jetbrains.jsonSchema.extension.SchemaType;
import com.jetbrains.jsonSchema.impl.JsonSchemaVersion;
import com.redhat.devtools.lsp4ij.LSPIJUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -30,7 +29,6 @@
* Abstract base class for JSON schema file providers that are based on JSON schema files bundled in the plugin distribution.
*/
abstract class AbstractLSPJsonSchemaFileProvider implements JsonSchemaFileProvider {

private final String jsonSchemaPath;
private final String jsonFilename;
private VirtualFile jsonSchemaFile = null;
Expand All @@ -49,7 +47,7 @@ public final VirtualFile getSchemaFile() {
jsonSchemaFile = jsonSchemaFileUrl != null ? VirtualFileManager.getInstance().findFileByUrl(jsonSchemaFileUrl) : null;
// Make sure that the IDE is using the absolute latest version of the JSON schema
if (jsonSchemaFile != null) {
LSPIJUtils.refreshBundledFile(jsonSchemaFile);
jsonSchemaFile.refresh(true, false);
}
}
return jsonSchemaFile;
Expand Down

0 comments on commit 7e6e64a

Please sign in to comment.