WhatsApp / erlang-language-platform

Erlang Language Platform. LSP server and CLI.
https://whatsapp.github.io/erlang-language-platform/
Apache License 2.0
209 stars 16 forks source link

The location of the error warning is abnormal when use '\r\n' #22

Closed misaki214 closed 2 months ago

misaki214 commented 2 months ago

Describe the bug

The location of the error warning is abnormal when use '\r\n'

To Reproduce

-module(test).\r\n \r\n -export([test/0]).\r\n \r\n \r\n \r\n \r\n \r\n test() ->\r\n Test = 1,\r\n ok.\r\n

Expected behavior

Report the correct location of the error.

Actual behavior

use CRLF

crlf

use LF

lf

Context

alanz commented 2 months ago

I just tried to reproduce this error, by putting a test project file into CRLF mode. The locations continue to be correct, even after a complete VS Code restart.

Screenshot 2024-04-22 at 11 32 13

And I have confirmed that it has 0d0a as terminator.

misaki214 commented 2 months ago

image Hi, @alanz. I reproduced the bug in test project file.It needs multiple \r\n newline characters added at line 4.

alanz commented 2 months ago

Ok, I can reproduce that too. And I see the unused function diagnostic comes from the erlang_service i.e. otp compiler.