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

Off-by-one error in hover #394

Closed
thomasfaingnaert opened this issue Sep 24, 2019 · 1 comment
Closed

Off-by-one error in hover #394

thomasfaingnaert opened this issue Sep 24, 2019 · 1 comment
Assignees
Labels

Comments

@thomasfaingnaert
Copy link

It appears there is an off-by-one when parsing the column of the textDocument/hover request.
For example, given the following file:

println("Hello World")

Hover on p doesn't return anything:

Tue 24 Sep 2019 11:39:38 CEST:["--->",1,"julia",{"method":"textDocument/hover","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///home/thomas/test.jl"},"position":{"character":0,"line":0}}}]
Tue 24 Sep 2019 11:39:49 CEST:["<---",1,"julia",{"response":{"id":2,"jsonrpc":"2.0","result":{"contents":[]}},"request":{"id":2,"jsonrpc":"2.0","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/thomas/test.jl"},"position":{"character":0,"line":0}}}}]

But any character from r up to, and including, ( works:

Tue 24 Sep 2019 11:41:14 CEST:["--->",1,"julia",{"method":"textDocument/hover","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///home/thomas/test.jl"},"position":{"character":7,"line":0}}}]
Tue 24 Sep 2019 11:41:14 CEST:["<---",1,"julia",{"response":{"id":3,"jsonrpc":"2.0","result":{"contents":[{"language":"julia","value":"\nprintln([io::IO], xs...)\n"},"\n\nPrint (using [`print`](@ref)) `xs` followed by a newline. If `io` is not supplied, prints to [`stdout`](@ref).\n\n# Examples\n\n",{"language":"julia","value":"\njulia> println(\"Hello, world\")\nHello, world\n\njulia> io = IOBuffer();\n\njulia> println(io, \"Hello, world\")\n\njulia> String(take!(io))\n\"Hello, world\\n\"\n"},"\n"]}},"request":{"id":3,"jsonrpc":"2.0","method":"textDocument/hover","params":{"textDocument":{"uri":"file:///home/thomas/test.jl"},"position":{"character":7,"line":0}}}}]
@davidanthoff davidanthoff added this to the v0.7.0 milestone Dec 1, 2019
@davidanthoff davidanthoff modified the milestones: v0.7.0, v1.0.1 Dec 14, 2019
@davidanthoff davidanthoff modified the milestones: v1.0.1, v1.0.2 Dec 14, 2019
@davidanthoff davidanthoff modified the milestones: Next, Current Dec 17, 2019
@davidanthoff davidanthoff modified the milestones: Next, Current Dec 19, 2019
@ZacLN
Copy link
Contributor

ZacLN commented Jan 15, 2020

Fixed by b1a9b33

@ZacLN ZacLN closed this as completed Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants