Skip to content

add text range and position methods to extension API TextDocument type

Warren Gifford requested to merge ext-editor-pos-methods into master

Created by: sqs

This makes it easier for extensions to work with positions and ranges, such as determining the token that surrounds the position where a user hovered. Many extensions currently implement this in a hacky and duplicative way.

This is based on VS Code's implementation. The prefix sum computer is not available in any npm packages, so it's copied in here. It is well tested and hasn't changed in many years upstream, so this is acceptable.

Merge request reports

Loading