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

Found the limitation of getCurrentAttributeName() method of AbstractPositionRequest class #583

Closed
Seiphon opened this issue Oct 24, 2019 · 4 comments
Assignees
Labels
completion This issue or enhancement is related to completion support debt This issue or enhancement is related to technical debt hover
Milestone

Comments

@Seiphon
Copy link
Contributor

Seiphon commented Oct 24, 2019

Hi @angelozerr and @fbricon

I found a limitation for getCurrentAtrributeName() method of AbstractPositionReqest class.

When I try to support hover feature for attribute name, I found it's difficult to get correct attribute name.
@Override public String getCurrentAttributeName() { return currentAttributeName; }

It because before we use get method, we should set the attribute name first (Like XMLCompletions.doComplete method does).

How about try to get the attribute name by DOM first. Like getCurrentTag() does.
Like follows:

@Override
public String getCurrentAttributeName() {
if (node != null && node.isAttribute() && ((DOMAttr) node).getName() != null) {
return ((DOMAttr) node).getName();
}
return currentAttributeName;
}

@Seiphon
Copy link
Contributor Author

Seiphon commented Oct 24, 2019

Please see this PR #584.

@angelozerr
Copy link
Contributor

@Seiphon please add a test with your usecase.

@Seiphon
Copy link
Contributor Author

Seiphon commented Oct 24, 2019

@Seiphon please add a test with your usecase.

Hi @angelozerr , I added a test on AggregetedHoverValuesTest. If it's not allowable, I will add a new test class for it.

@angelozerr angelozerr added completion This issue or enhancement is related to completion support debt This issue or enhancement is related to technical debt hover labels Oct 29, 2019
@angelozerr
Copy link
Contributor

Fixed with #584

@angelozerr angelozerr added this to the v0.9.2 milestone Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion This issue or enhancement is related to completion support debt This issue or enhancement is related to technical debt hover
Projects
None yet
Development

No branches or pull requests

2 participants