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 error range for EntityNotDeclared #531

Merged
merged 1 commit into from
Jul 22, 2019
Merged

Fix error range for EntityNotDeclared #531

merged 1 commit into from
Jul 22, 2019

Conversation

xorye
Copy link

@xorye xorye commented Jul 22, 2019

Fixes the error range mentioned in #518

image

I am using the name of the undeclared entity, (in this case, "nbsp"), looking for the substring "&nbsp" in the line provided by xerces to determine the error range.

Signed-off-by: David Kwon [email protected]

@fbricon fbricon requested a review from NikolasKomonen July 22, 2019 14:49
@fbricon
Copy link
Contributor

fbricon commented Jul 22, 2019

Could we underline both the starting & and the closing ;? @angelozerr wdyt?

@fbricon
Copy link
Contributor

fbricon commented Jul 22, 2019

That's how eclipse does it:

Screen Shot 2019-07-22 at 7 28 26 PM

int end = start + name.length();
Position startPosition = new Position(line, start);
Position endPosition = new Position(line, end);
return new Range(startPosition, endPosition);
Copy link
Contributor

Choose a reason for hiding this comment

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

note for later: we should have a public static Range newRange(line, start, end) utility method somewhere

Copy link
Author

Choose a reason for hiding this comment

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

should this change take place in a different PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

definitely yes

Copy link
Contributor

Choose a reason for hiding this comment

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

XMLPositionUtility is the best place to add this method

@fbricon fbricon merged commit a434b33 into eclipse-lemminx:master Jul 22, 2019
@angelozerr
Copy link
Contributor

note for later: we should have a public static Range newRange(line, start, end) utility method somewhere

XMLPositionUtility is the best place to add this method

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.

4 participants