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

editor should ignore line ending edits #3980

Closed
dbaeumer opened this issue Mar 10, 2016 · 2 comments
Closed

editor should ignore line ending edits #3980

dbaeumer opened this issue Mar 10, 2016 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@dbaeumer
Copy link
Member

The TS formatter produces line ending edits in some cases. This seems to make the editor fail which results in rejecting the edit. The code that make the edit fail is:

            if (loserCursorsMap.hasOwnProperty('0')) {
                // These commands are very messed up
                console.warn('Ignoring commands');
                return false;
            }

@alexandrudima it is best if I show you the failing edits on my machine. I disabled parts of the code again to not make the formatter fail.

@dbaeumer dbaeumer added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority labels Mar 10, 2016
@dbaeumer
Copy link
Member Author

The failing edit tree looks like this:

[1,8] [1,9] '\n'
[3,17] [3,18] '\n'
[3,18] [3,18] '    '
[4,1] [4,5] '        '

To test do the following

  • in file formattingProvider.ts uncomment the additional settings in the method getFormatOptions at the end of the file.
  • build and run. Create ts file with the content
class A {
    someProperty = false;
    someMethod() {
    this.someMethod();
    }
}
  • format the file

@dbaeumer
Copy link
Member Author

Thanks!

@alexdima alexdima assigned dbaeumer and unassigned alexdima Mar 21, 2016
@dbaeumer dbaeumer added the verified Verification succeeded label Mar 21, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants