lua-language-server
lua-language-server copied to clipboard
String should be sanitized on hover
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Linux
What is the issue affecting?
Hover
Expected Behaviour
Consider the following code:
s = "one\ntwo\nthree"
When hovering over it, I'd expect to see the newline characters just as I wrote them in.
Actual Behaviour
Instead, the newlines and tabs would get "expanded", breaking the way the hover looks.
Reproduction steps
- Create a string variable with newline (\n) or tab characters (\t)
- hover over the variable
Additional Notes
No response
Log File
No response
It's just the special characters that need to be double-escaped. Should be quite simple to do. Here is an example from awesome inspect.lua by kikito.
It's the same for table keys. The following snippet, when hovered gives:
local foo = {
["some\\path"] = "bar",
}