|
8 | 8 | * Contributors:
|
9 | 9 | * Red Hat, Inc. - initial API and implementation
|
10 | 10 | ******************************************************************************/
|
11 |
| -package com.redhat.devtools.intellij.quarkus; |
| 11 | +package com.redhat.devtools.intellij.quarkus.json; |
12 | 12 |
|
13 | 13 | import com.intellij.json.JsonFileType;
|
14 | 14 | import com.intellij.openapi.Disposable;
|
|
25 | 25 | import com.redhat.devtools.intellij.lsp4mp4ij.classpath.ClasspathResourceChangedManager;
|
26 | 26 | import com.redhat.devtools.intellij.lsp4mp4ij.psi.core.PropertiesManager;
|
27 | 27 | import com.redhat.devtools.intellij.lsp4mp4ij.psi.internal.core.ls.PsiUtilsLSImpl;
|
| 28 | +import com.redhat.devtools.intellij.quarkus.QuarkusPluginDisposable; |
28 | 29 | import org.apache.commons.lang3.tuple.MutablePair;
|
29 | 30 | import org.eclipse.lsp4mp.commons.ClasspathKind;
|
30 | 31 | import org.eclipse.lsp4mp.commons.DocumentFormat;
|
|
40 | 41 | import java.util.Set;
|
41 | 42 | import java.util.concurrent.ConcurrentHashMap;
|
42 | 43 |
|
43 |
| -public class QuarkusProjectService implements ClasspathResourceChangedManager.Listener, Disposable { |
44 |
| - private static final Logger LOGGER = LoggerFactory.getLogger(QuarkusProjectService.class); |
| 44 | +public class QuarkusJsonSchemaProjectService implements ClasspathResourceChangedManager.Listener, Disposable { |
| 45 | + private static final Logger LOGGER = LoggerFactory.getLogger(QuarkusJsonSchemaProjectService.class); |
45 | 46 |
|
46 | 47 | private final Map<Module, MutablePair<VirtualFile, Boolean>> schemas = new ConcurrentHashMap<>();
|
47 | 48 |
|
48 |
| - public static QuarkusProjectService getInstance(@NotNull Project project) { |
49 |
| - return project.getService(QuarkusProjectService.class); |
| 49 | + public static QuarkusJsonSchemaProjectService getInstance(@NotNull Project project) { |
| 50 | + return project.getService(QuarkusJsonSchemaProjectService.class); |
50 | 51 | }
|
51 | 52 |
|
52 | 53 | private final MessageBusConnection connection;
|
53 | 54 |
|
54 |
| - public QuarkusProjectService(Project project) { |
| 55 | + public QuarkusJsonSchemaProjectService(Project project) { |
55 | 56 | connection = project.getMessageBus().connect(QuarkusPluginDisposable.getInstance(project));
|
56 | 57 | connection.subscribe(ClasspathResourceChangedManager.TOPIC, this);
|
57 | 58 | }
|
58 | 59 |
|
59 |
| - |
60 | 60 | public VirtualFile getSchema(Module module) {
|
61 | 61 | var schemaEntry = schemas.get(module);
|
62 | 62 | if (schemaEntry == null || !schemaEntry.getRight()) {
|
|
0 commit comments