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

Protocol assumes editors work uniformly wrt file encoding and newlines. #80

Closed
CyrusNajmabadi opened this issue Oct 3, 2016 · 1 comment

Comments

@CyrusNajmabadi
Copy link

See microsoft/TypeScript#2343 for more details.

The protocol is Line/Column based. So the server produces results that include line/character information from the perspective of the server which may not correspond to actual lines/character from the perspective of the client.

For example, say the file contents are:

"fooparagraph separatorbarnew linequux". TSServer will interpret this as two lines, whereas a client may only view it as a single line. If TS server then reports an issue with the 'b' in 'bar' it will report the issue at "Line 2, column 1". However, the client will intepret that as being an the line with 'quux'.

@dbaeumer dbaeumer added this to the November 2016 milestone Oct 14, 2016
@dbaeumer
Copy link
Member

Agree on the problem. For now I speced that valid end of line squences are:

export const EOL: string[] = ['\n', '\r\n', '\r'];

On a protocol level there is not more I can do than specing this. I will close the issue. If we need to support additional end of line sequences or different document types we need to extend the protocol.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants