microsoft / vscode-black-formatter

Formatting support for Python using the Black formatter
https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter
MIT License
146 stars 35 forks source link

Add positionEncoding support when calculating diffs #409

Closed karthiknadig closed 6 months ago

karthiknadig commented 6 months ago

Fixes https://github.com/microsoft/vscode-black-formatter/issues/395

karthiknadig commented 6 months ago

@charliermarsh This might be relevant for Ruff diff calculation for formatting with LSP. The ranges in TextEdits have to be calculated using encoding selected in positionEncoding filed of client and server capability. There are 3 possible encodings supported for IDEs. VS Code itself only supports UTF-16.