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

Extension completion should use node text range #837

Closed

Conversation

AObuchow
Copy link
Contributor

@AObuchow AObuchow commented Aug 7, 2020

Fix #723

Signed-off-by: Andrew Obuchowicz [email protected]

@AObuchow
Copy link
Contributor Author

AObuchow commented Aug 7, 2020

This probably needs a test.

I can confirm however that it fixes the issue related to eclipse-lemminx/lemminx-maven#127 (I removed the workaround but kept the test from that PR)

@AObuchow AObuchow requested a review from angelozerr August 7, 2020 16:26
@angelozerr
Copy link
Contributor

This probably needs a test.

Yes please.

Copy link
Contributor

@angelozerr angelozerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it seems OK, but we need test to check that.

@AObuchow
Copy link
Contributor Author

@angelozerr should the test just extend CompletionParticipantAdapter, perform a completion and test that the completion replacement range is the whole node's text?

@AObuchow AObuchow force-pushed the completionRequest_slash_bug branch from 763ed34 to f74c30e Compare August 11, 2020 17:14
@@ -753,6 +754,18 @@ private void collectInsideContent(CompletionRequest request, CompletionResponse
collectCloseTagSuggestions(tagNameRange, true, true, false, request, response);
}
// Participant completion on XML content
if (request.getNode() instanceof DOMElement) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section about DOMElement probably should be removed, I don't think it actually addresses the issue that was reported (even though it made downstream lemminx-maven workaround tests pass..).

The original bug was about triggering a completion on text, not on a node?


@Test
private void testHTMLOnXMLContentCompletion() throws BadLocationException {
// TODO: This isin't getting called by Junit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why I couldn't get my test to be called :P Is there anything I'm missing to get it called? For now I put the test code in testHTMLAttributeValueCompletion so that it'd be called on CI

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be public

@angelozerr
Copy link
Contributor

This PR is replaced with #866

@angelozerr angelozerr closed this Sep 2, 2020
@AObuchow AObuchow deleted the completionRequest_slash_bug branch September 2, 2020 13:49
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

Successfully merging this pull request may close these issues.

completionRequest.getReplaceRange() is erroneous in text that contains /
3 participants