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

Convert from 1- to 0-based indexing for TypeScript completion spans #15679

Merged
merged 1 commit into from
Nov 18, 2016

Conversation

aozgaa
Copy link
Contributor

@aozgaa aozgaa commented Nov 17, 2016

Fixes an issue where module and triple slash completions had an off-by-one error with the indexing of text spans. Corresponding issues in the TypeScript repo are:

microsoft/TypeScript#12165
microsoft/TypeScript#11462

@mention-bot
Copy link

@aozgaa, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dbaeumer, @egamma and @jrieken to be potential reviewers.

@msftclas
Copy link

Hi @aozgaa, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Arthur Ozga). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@billti
Copy link
Member

billti commented Nov 17, 2016

Looks good. I can see in the protocol docs their API expects 0-based (see https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#position ). You can see in other operations such as formatting ( https://github.com/Microsoft/vscode/blob/master/extensions/typescript/src/features/formattingProvider.ts#L172 ) where they are converting from the TypeScript 1-based positions - so this seems consistent with existing features.

@dbaeumer
Copy link
Member

@aozgaa thanks for providing this!

@dbaeumer dbaeumer merged commit a6af151 into microsoft:master Nov 18, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants