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

Migrate to 0-indexed spans #669

Open
ReeceHumphreys opened this issue Oct 31, 2023 · 2 comments
Open

Migrate to 0-indexed spans #669

ReeceHumphreys opened this issue Oct 31, 2023 · 2 comments
Labels
easy Good for newcomers proposal task
Milestone

Comments

@ReeceHumphreys
Copy link
Contributor

Currently, our spans are 1-indexed to be more in line with how files are represented in editors. However, this has proven to be painful when implementing things like a language server, as the LSP protocol assumes 0-based positions. It would be nice to switch to using 0-based indexing for better compatibility with other tools.

@pepone
Copy link
Member

pepone commented Oct 31, 2023

If we change this we will have to fix the MSBuild task https://github.com/icerpc/icerpc-csharp/blob/0b36976cc3acb632e21c85f2982153cc0872f1ef/tools/IceRpc.Slice.Tools/SliceCCSharpTask.cs#L134-L142

So far there would be always tools that are 1-based or 0-based, we should pick one and stick with it.

@ReeceHumphreys
Copy link
Contributor Author

If we change this we will have to fix the MSBuild task https://github.com/icerpc/icerpc-csharp/blob/0b36976cc3acb632e21c85f2982153cc0872f1ef/tools/IceRpc.Slice.Tools/SliceCCSharpTask.cs#L134-L142

So far there would be always tools that are 1-based or 0-based, we should pick one and stick with it.

Yes, I just think 0 based is more natural - we should do a survey of common tools and see if more are 0 based or 1 based. Generally for programming im inclined to assume things are 0 based.

@InsertCreativityHere InsertCreativityHere added this to the Future milestone Nov 22, 2023
@ReeceHumphreys ReeceHumphreys changed the title Switch to using 0-indexed spans Migrate to 0-indexed spans Feb 8, 2024
@InsertCreativityHere InsertCreativityHere added easy Good for newcomers task labels Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Good for newcomers proposal task
Projects
None yet
Development

No branches or pull requests

3 participants