Skip to content

Commit

Permalink
fix(language): documentation for non-imported libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
kris7t committed Dec 16, 2024
1 parent 7159795 commit 7b6cf6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ protected void postProcessImportProposals(List<IEObjectDescription> descriptions
var proxy = ProblemFactory.eINSTANCE.createProblem();
((InternalEObject) proxy).eSetProxyURI(uri);
var description = new EObjectDescription(suggestedName, proxy, Map.of(
ProblemResourceDescriptionStrategy.SHADOWING_KEY,
ProblemResourceDescriptionStrategy.SHADOWING_KEY_PROBLEM,
ProblemResourceDescriptionStrategy.MODULE_KIND, ModuleKind.MODULE.getName()
));
descriptions.add(description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ private static boolean isShadow(IEObjectDescription candidate, EObject eObject)

@Nullable
public String getDocumentation(IEObjectDescription candidate, ContentAssistContext context) {
if (candidate.getUserData(ProblemResourceDescriptionStrategy.SHADOWING_KEY) == null) {
// Description was not generated by our ResourceDescriptionStrategy, so we must trigger proxy resolution.
return getDocumentation(candidate.getEObjectOrProxy());
}
if (ProblemPackage.Literals.PROBLEM.isSuperTypeOf(candidate.getEClass())) {
var name = NamingUtil.stripRootPrefix(candidate.getQualifiedName());
return getProblemDocumentation(context.getResource(), name);
}
if (candidate.getUserData(ProblemResourceDescriptionStrategy.SHADOWING_KEY) == null) {
// Description was not generated by our ResourceDescriptionStrategy, so we must trigger proxy resolution.
return getDocumentation(candidate.getEObjectOrProxy());
}
return candidate.getUserData(DocumentationCommentParser.DOCUMENTATION);
}

Expand Down

0 comments on commit 7b6cf6e

Please sign in to comment.