Open gpersoon opened 2 years ago
Pinging @christianparpart
I will respond ASAP. Thanks for the reminder. :)
@christianparpart I can confirm that my solc
(version 0.8.16+commit.07a7930e.Linux.g++
) has the same problem, definitions are always empty.
OS: Arch Linux
Editor: neovim with built-in lsp (config from https://github.com/neovim/nvim-lspconfig)
The solc
lsp is working properly otherwise, e.g. detecting syntax errors or faulty imports.
@gpersoon Would you mind trying out this branch? Please tell me if you need a binary I should create for you (otherwise, just checkout the PRs branch and build).
@sebastianst while the above linked PR does fix it indeed for me, I am not sure it does for you. The reason why @gpersoon did have empty goto-def results is because URL decoding on his Windows platform is much more relevant (due to drive letters) than on Linux. Since you mentioned Linux in your version string, I wonder if it does fix it for you, too. Otherwise I'd like to get some I/O trace from you (can neovim's builtin lsp store one to disk? :thinking:).
@christianparpart thanks, the PR didn't fix the problem for me, so it seems to be a different issue. Here is a trace log when trying to go-to-definition when on an identifier defined in the same Solidity file:
[DEBUG][2022-09-27 11:32:28] .../lua/vim/lsp.lua:1023 "LSP[solc]" "client.request" 1 "textDocument/definition" { position = { character = 19, line = 59 }, textDocument = { uri = "file:///home/seb/yg/yieldgate/packages/contracts/contracts/YieldGate.sol" }} <function 1> 1
[DEBUG][2022-09-27 11:32:28] .../vim/lsp/rpc.lua:347 "rpc.send" { id = 22, jsonrpc = "2.0", method = "textDocument/definition", params = { position = { character = 19, line = 59 }, textDocument = { uri = "file:///home/seb/yg/yieldgate/packages/contracts/contracts/YieldGate.sol" } }}
[DEBUG][2022-09-27 11:32:28] .../vim/lsp/rpc.lua:454 "rpc.receive" { id = 22, jsonrpc = "2.0", result = {}}
[TRACE][2022-09-27 11:32:28] ...lsp/handlers.lua:488 "default_handler" "textDocument/definition" { ctx = '{\n bufnr = 1,\n client_id = 1,\n method = "textDocument/definition",\n params = {\n position = {\n character = 19,\n line = 59\n },\n textDocument = {\n uri = "file:///home/seb/yg/yieldgate/packages/contracts/contracts/YieldGate.sol"\n }\n }\n}', result = {}}
[INFO][2022-09-27 11:32:28] ...lsp/handlers.lua:324 "textDocument/definition" "No location found"
@christianparpart could you create a binary? (i'm stuck on getting the boost library to work)
Op vr 2 sep. 2022 om 15:37 schreef Christian Parpart < @.***>:
@gpersoon https://github.com/gpersoon Would you mind trying out this branch? Please tell me if you need a binary I should create for you (otherwise, just checkout the PRs branch and build).
@sebastianst https://github.com/sebastianst while the above linked PR does fix it indeed for me, I am not sure it does for you. The reason why @gpersoon https://github.com/gpersoon did have empty goto-def results is because URL decoding on his Windows platform is much more relevant (due to drive letters) than on Linux. Since you mentioned Linux in your version string, I wonder if it does fix it for you, too. Otherwise I'd like to get some I/O trace from you (can neovim's builtin lsp store one to disk? 🤔).
— Reply to this email directly, view it on GitHub https://github.com/ethereum/solidity/issues/13035#issuecomment-1235516341, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJXKE32BI67WZ4STOYLWTLV4H7IXANCNFSM5WFK34HA . You are receiving this because you were mentioned.Message ID: @.***>
@gpersoon You can get the binary from the CI runs on that branch. For example here are the artifacts of the most recent run of the CI job that produces a static Linux binary.
Hi @cameel, thanks for the link to the CI. Is there a windows binary in there too? I can't find it. As the issue is windows specific it can't be tested with the linux binary.
Yeah: b_win
artifacts.
I've tested the windows binary 0.8.18-ci.2022.11.4+commit.a2de5d4b.Windows.msvc
and the output is still the same. Not sure if this rpc call is supposed to give any output.
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///C%3A/tmp/solidity/test.sol"},"position":{"character":3,"line":2}}}
on_message_received: Content-Length: 36
{"id":1,"jsonrpc":"2.0","result":[]}
Description
Environment
Steps to Reproduce
setup
Install
solc-windows.exe
inC:\tmp\solidity\
InstallNotepad++
Setup a language definition for Solidity inNotepad++
(for example viahttps://github.com/alin1popa/solidity-notepadplusplus-userdefined-highlight
) Downloadhttps://github.com/Ekopalypse/NppLspClient/releases/download/v.0.0.9-alpha/NppLspClient_x64.zip
InstallNppLspClient.dll
inC:\Program Files\Notepad++\plugins\NppLspClient
Edit config file via menuopen configuration file
(NppLspClientConfig.toml
) to contain:Have some sample soldity files in
C:\tmp\solidity\
test.sol:test2.sol
test in Notepad++
Open file
test.sol
inNotepad++
In menu optionPlugins/NppLspClient_x64
chooseToggle Console
to see debug output. Put the cursor onimport
In menu optionPlugins/NppLspClient_x64
chooseGoto Definition
Now nothing happens in the editor main screen. The LSP output console shows:{"id":4,"jsonrpc":"2.0","result":[]}
So somehow the lookup doesn't work. The same happens with anything else I select.Note: the detection of syntax errors does work and is shown in the editor, so the LSP interaction does work.
full log