Skip to content

Cursor position not maintained after returning TextEdit[] from provideDocumentFormattingEdits #755

Closed

Description

@lukehoban

I would have expected the cursor position to be maintained (as best it can in case it falls within a delete range) after applying a set of TextEdits returned by APIs such as provideDocumentFormattingEdits.

Instead, I am seeing the cursor remain at the same absolute offset relative to the beginning of the source in the final result, which results in moving the logical location in source text where the user was editing.

Can Code automatically handle this when it applies TextEdit[] objects? Or should extensions be adding their own logic to try and compensate for this?

Activity

  1. alexdima commented on Nov 30, 2015

    @alexdima
    Member

    Luke Hoban (@lukehoban) Can you please help me out with a specific before text, before selection and edit operations

  2. lukehoban commented on Nov 30, 2015

    @lukehoban
    MemberAuthor

    I might not be able to, since we ended up using a pretty different approach to this. I'll close this for now and will reopen if I'm able to recreate an example of the problem.

  3. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions