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

Make PositionEncodingKind a type #1442

Merged
merged 2 commits into from
Apr 13, 2022

Conversation

michaelpj
Copy link
Contributor

As discussed here:
f9c85d5#r70968669

I made a change that reflected the existing state, but looking at it, it still reads somewhat ambiguously to me.
We are talking about an overall "position encoding", but in fact it only has quite a specific meaning: what is counted by character offsets.

If we were open to a slightly bigger change, we could consider something like:

// with a proper type obviously
type CharacterOffsetUnit = 'utf-8-codeunits'|'utf-16-codeunits'|'unicode-codepoints';
interface PositionCapabilities {
  characterOffsetUnits: CharacterOffsetUnit;
}

@ghost
Copy link

ghost commented Apr 11, 2022

CLA assistant check
All CLA requirements met.

@nemethf
Copy link

nemethf commented Apr 12, 2022

Maybe I'm overthinking this, but explaining the original a𐐀b example of the current specification for each encoding would make this even clearer. Or not. Thank you.

@michaelpj
Copy link
Contributor Author

Maybe I'm overthinking this, but explaining the original a𐐀b example of the current specification for each encoding would make this even clearer. Or not. Thank you.

I think so long as we're referring to clearly understood ways of dealing with text, we can assume that programmers will go elsewhere to understand what e.g. "indexing in UTF-8 code units" means.

@dbaeumer dbaeumer merged commit e821641 into microsoft:gh-pages Apr 13, 2022
@dbaeumer dbaeumer added this to the 3.17 milestone Apr 13, 2022
@dbaeumer
Copy link
Member

I think so long as we're referring to clearly understood ways of dealing with text, we can assume that programmers will go elsewhere to understand what e.g. "indexing in UTF-8 code units" means.

@michaelpj are you willing to provide this as a PR as well?

@michaelpj
Copy link
Contributor Author

I meant that I think the current text is clear enough, since it uses standard terminology. Perhaps @nemethf disagrees?

@dbaeumer
Copy link
Member

@michaelpj sorry misunderstood.

@nemethf
Copy link

nemethf commented Apr 15, 2022

Perhaps @nemethf disagrees?

I don't.

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.

3 participants