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

Inconsistent definition of endColumn. #171

Closed
lcartey opened this issue May 15, 2018 · 3 comments
Closed

Inconsistent definition of endColumn. #171

lcartey opened this issue May 15, 2018 · 3 comments
Labels
bug CSD.1 Will be fixed in CSD.1. resolved-fixed

Comments

@lcartey
Copy link

lcartey commented May 15, 2018

3.22.7 endColumn property states:

When a region object represents a text region, it MAY contain a property named endColumn, which SHALL have an integer value equal to the column number of the last character in the region.

This specifies that the endColumn is "inclusive". However, in 3.22.2 Text regions, there are multiple references that suggest the endColumn should be "exclusive", i.e. it should point to the next column after the region.

Two examples from 3.22.2:

If endLine is the same as startLine and endColumn is the same as startColumn, the length of the region SHALL be taken to be 0.

This only makes sense if the endColumn is exclusive - if it's inclusive, you cannot represent regions of one character.

EXAMPLE 1: Suppose a text file contains the following line, on line 5:

abcde

Then the region with startLine = 5, startColumn = 3, endLine = 5, and endColumn = 6 represent the three characters cde. This is the case whether or not the line ends with a newline sequence.

endColumn is clearly specified as the column after the region here.

I am assuming that the definition in endColumn is wrong - it seems to be more consistent, and make more sense for it to be exclusive.

@michaelcfanning
Copy link
Contributor

yes, endColumn should consistently be excluded. this will be addressed in #93

@ghost ghost self-assigned this May 21, 2018
@ghost ghost added bug CSD.1 Will be fixed in CSD.1. labels May 21, 2018
@ghost
Copy link

ghost commented May 21, 2018

@lukecartey Yes. We are now consistently "half-open". I'll send mail shortly.

@ghost
Copy link

ghost commented May 24, 2018

This is covered by the change draft for #93.

ghost pushed a commit that referenced this issue May 24, 2018
ghost pushed a commit that referenced this issue May 31, 2018
@ghost ghost closed this as completed May 31, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CSD.1 Will be fixed in CSD.1. resolved-fixed
Projects
None yet
Development

No branches or pull requests

2 participants