lahodaj opened a new pull request, #6690: URL: https://github.com/apache/netbeans/pull/6690
When a file is opened, the `didOpen` called in the LSP server is called. The LSP client (tested with Visual Studio Code) sends the file text/content with their real line endings, which may be `\r\n`. Internally, the NB server only uses `\n`. In the `didOpen` callback, when the server compares the text from the client and the internal document, the contents will be different, and the server will re-set the Document's content to the received file content. Such Document is internally marked as modified, which may cause problems or accentuate other problems (see for example https://github.com/oracle/javavscode/issues/51 or https://github.com/oracle/javavscode/issues/26). In this patch, I've tried to fix this, by normalizing the line endings before the comparison. I've tried to make this in a way that files with '\n' don't pay additional cost for line endings normalization in the common cases (i.e. when the file content as sent from the client, and the content of the document match). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
