I’ve noticed that we use line/character indices based on 1 for ranges and positions in packages/plugin-ext/src/api/model.ts. and …/plugin-api.ts.
This seems confusing to me. In the plugin API (both vscode and theia), in LSP and even in some of the theia internal classes (ProblemManager, for example); we use 0-based positions and ranges.
I feel it would be very helpful if we had a clear policy on this and would use the same base everywhere. I think it comes down to if theia is based on LSP (and related technologies) with Monaco as an implementation detail or if Monaco is our base and LSP, etc. are connectors to the outside world.
I understand that those are different. However, which should be the primary representation in Theia? Should we do 0-based and convert when we move the data into Monaco? Or should we keep 1-based positions everywhere and therefore convert positions as soon as we get them from LSP or a vscode plugin?