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

fix: Java file diagnostics is not refreshed when properties file is saved #1084

Merged
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 @@ -99,10 +99,8 @@ public List<MarkupContent> getMarkupContents(PsiElement element, @Nullable PsiEl
// (LSP textDocument/completion request)
return ((LSPPsiElementForLookupItem) element).getDocumentation();
}
if (originalElement == null || !Objects.equals(element.getContainingFile(), originalElement.getContainingFile())) {
return null;
}
Editor editor = LSPIJUtils.editorForElement(element);

Editor editor = LSPIJUtils.editorForElement(originalElement);
if (editor == null) {
return null;
}
Expand All @@ -111,7 +109,7 @@ public List<MarkupContent> getMarkupContents(PsiElement element, @Nullable PsiEl
VirtualFile file = originalElement.getContainingFile().getVirtualFile();
if (LSPVirtualFileWrapper.hasWrapper(file)) {
int targetOffset = getTargetOffset(originalElement);
return LSPVirtualFileWrapper.getLSPVirtualFileWrapper(file).getHoverContent(element, targetOffset, editor);
return LSPVirtualFileWrapper.getLSPVirtualFileWrapper(file).getHoverContent(originalElement, targetOffset, editor);
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected List<MicroProfileDefinition> collectDefinitions(String propertyKey, Ra
// Collect all properties files (properties, yaml files) where the given
// property key is configured
List<MicroProfileConfigPropertyInformation> infos = PsiMicroProfileProjectManager.getInstance(context.getJavaProject().getProject())
.getJDTMicroProfileProject(javaProject).getPropertyInformations(propertyKey);
.getMicroProfileProject(javaProject).getPropertyInformations(propertyKey);
if (!infos.isEmpty()) {
return infos.stream().map(info -> {
MicroProfileDefinition definition = new MicroProfileDefinition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public Hover collectHover(JavaHoverContext context) {
propertyKey = propertyReplacer.apply(propertyKey);
}
PsiMicroProfileProject mpProject = PsiMicroProfileProjectManager.getInstance(javaProject.getProject())
.getJDTMicroProfileProject(javaProject);
.getMicroProfileProject(javaProject);
List<MicroProfileConfigPropertyInformation> propertyInformation = getConfigPropertyInformation(propertyKey,
annotation, defaultValueAnnotationMemberName, typeRoot, mpProject, utils);
return new Hover(getDocumentation(propertyInformation, context.getDocumentFormat(),
Expand Down
Loading
Loading