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

Pressing hyperlinks in plugin.xml editor does not lead to location of identifier #1611

Open
jonahgraham opened this issue Feb 11, 2025 · 2 comments

Comments

@jonahgraham
Copy link
Contributor

Note that the PR #1609 does resolve the apparent bug of #1608, but I don't know if it is an error that attributeMap for nature ids have no associated IConfigurationElement. The result of them not having one could be a bug itself, or by design.

The result of them not having one is that the id link in the screenshot does not lead anywhere. See the check in this code:

protected void openReference() {
Map<String, IConfigurationElement> attributeMap = PDESchemaHelper.getValidAttributes(getAttribute());
String id = text.getText();
// TODO this is hackish
IConfigurationElement element = attributeMap.get(id);
if (element != null) {

This is the hyperlink I am referring to:

Image

This issue only seems to affect identifiers. Class and file links seem to work fine.

Originally posted by @jonahgraham in #1608

@jonahgraham
Copy link
Contributor Author

It is not all id links that don't work. I can't tell if there is a regression here, or something that never worked.

Natured ids don't work - defined like this: basedOn="org.eclipse.core.resources.natures/@id"

But content-type Ids do work -defined like this: basedOn="org.eclipse.core.contenttype.contentTypes/content-type/@id"

For example in the UI this link works:

Image

The nulls end up in the map because of this code

// handle the core style identifier case
if (path.length == 2) {
attributesInfo.put(extension.getUniqueIdentifier(), null);
continue;
}

The gatherAttributes method only gets configuration elements if basedOn has 3+ segments. Since nature id refs have two segments, they don't work, but content types have three segments so they do work.

AFAICT nothing in this part of the code has changed anytime recently, so I don't think this is a regression.

@jonahgraham
Copy link
Contributor Author

I'm probably not spending anymore time on this, and I hope if someone want to pick this issue up the above is enough of a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant