Open ClaudeZsb opened 5 months ago
Same issue maybe: https://github.com/juanfranblanco/vscode-solidity/issues/437
@ClaudeZsb check the latest and see if it fixes it
On latest (vscode-solidity-server@0.0.171
), and curiously, the server seems to be trying to use multiple versions at once--and it insists on installing soljson-latest.js
, which I am assuming is where 0.8.19
is coming from... LSP log output attached. I have scrubbed from the log output some details about the code in question, but it is still largely complete.
[START][2024-02-21 23:39:24] LSP logging initiated [INFO][2024-02-21 23:39:24] .../vim/lsp/rpc.lua:662 "Starting RPC client" { args = { "--stdio" }, cmd = "/home/fluffywaffles/.npm/bin/vscode-solidity-server", extra = {}} [DEBUG][2024-02-21 23:39:24] .../vim/lsp/rpc.lua:284 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { textDocument = { callHierarchy = { dynamicRegistration = false }, codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = false, isPreferredSupport = true, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = {} }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } }, contextSupport = false, dynamicRegistration = false }, declaration = { linkSupport = true }, definition = { linkSupport = true }, documentHighlight = { dynamicRegistration = false }, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = false }, implementation = { linkSupport = true }, publishDiagnostics = { relatedInformation = true, tagSupport = { valueSet = { 1, 2 } } }, references = { dynamicRegistration = false }, rename = { dynamicRegistration = false, prepareSupport = true }, semanticTokens = { augmentsSyntaxTokens = true, dynamicRegistration = false, formats = { "relative" }, multilineTokenSupport = false, overlappingTokenSupport = true, requests = { full = { delta = true }, range = false }, serverCancelSupport = false, tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } }, signatureHelp = { dynamicRegistration = false, signatureInformation = { activeParameterSupport = true, documentationFormat = { "markdown", "plaintext" }, parameterInformation = { labelOffsetSupport = true } } }, synchronization = { didSave = true, dynamicRegistration = false, willSave = true, willSaveWaitUntil = true }, typeDefinition = { linkSupport = true } }, window = { showDocument = { support = true }, showMessage = { messageActionItem = { additionalPropertiesSupport = false } }, workDoneProgress = true }, workspace = { applyEdit = true, configuration = true, didChangeWatchedFiles = { dynamicRegistration = false, relativePatternSupport = true }, semanticTokens = { refreshSupport = true }, symbol = { dynamicRegistration = false, hierarchicalWorkspaceSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, workspaceEdit = { resourceOperations = { "rename", "create", "delete" } }, workspaceFolders = true } }, clientInfo = { name = "Neovim", version = "0.9.5" }, initializationOptions = "/home/fluffywaffles/.cache/nvim/vscode-solidity-server", processId = 1410116, ...} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "1", type = 3 }} [INFO][2024-02-21 23:39:25] ...lsp/handlers.lua:539 "1" [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "initVersion", type = 4 }} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "latest", type = 4 }} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { id = 1, jsonrpc = "2.0", result = { capabilities = { completionProvider = { resolveProvider = false, triggerCharacters = { "." } }, definitionProvider = true, hoverProvider = true, referencesProvider = true, textDocumentSync = 1, workspace = { workspaceFolders = { supported = true } } } }} [INFO][2024-02-21 23:39:25] ...lsp/handlers.lua:539 "initVersion" [INFO][2024-02-21 23:39:25] ...lsp/handlers.lua:539 "latest" [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:284 "rpc.send" { jsonrpc = "2.0", method = "initialized", params = vim.empty_dict()} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:284 "rpc.send" { jsonrpc = "2.0", method = "workspace/didChangeConfiguration", params = { settings = { solidity = { compileUsingRemoteVersion = "v0.8.23+commit.f704f362", formatter = "forge" } } }} [INFO][2024-02-21 23:39:25] .../lua/vim/lsp.lua:1344 "LSP[vscode-solidity-server]" "server_capabilities" { server_capabilities = { completionProvider = { resolveProvider = false, triggerCharacters = { "." } }, definitionProvider = true, hoverProvider = true, referencesProvider = true, textDocumentSync = { change = 1, openClose = true, save = { includeText = false }, willSave = false, willSaveWaitUntil = false }, workspace = { workspaceFolders = { supported = true } } }} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:284 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didOpen", params = { textDocument = { languageId = "solidity", text = "...", uri = "file:///home/fluffywaffles/dev/work/compound/quark/test/quark-core/EIP712.t.sol", version = 0 } }} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { id = 0, jsonrpc = "2.0", method = "client/registerCapability", params = { registrations = { { id = "5f1a2e47-6ae6-4663-bb1e-904b9d47b6c4", method = "workspace/didChangeWorkspaceFolders", registerOptions = vim.empty_dict() } } }} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "1", type = 3 }} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "initVersion", type = 4 }} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "v0.8.23+commit.f704f362", type = 4 }} [WARN][2024-02-21 23:39:25] ...lsp/handlers.lua:137 "The language server vscode-solidity-server triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless" [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:403 "server_request: callback result" { result = vim.NIL, status = true} [DEBUG][2024-02-21 23:39:25] .../vim/lsp/rpc.lua:284 "rpc.send" { id = 0, jsonrpc = "2.0", result = vim.NIL} [INFO][2024-02-21 23:39:25] ...lsp/handlers.lua:539 "1" [INFO][2024-02-21 23:39:25] ...lsp/handlers.lua:539 "initVersion" [INFO][2024-02-21 23:39:25] ...lsp/handlers.lua:539 "v0.8.23+commit.f704f362" [DEBUG][2024-02-21 23:39:27] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using the compiler selected: remote", type = 3 }} [INFO][2024-02-21 23:39:27] ...lsp/handlers.lua:539 "Validating using the compiler selected: remote" [DEBUG][2024-02-21 23:39:27] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using compiler version: 0.8.19+commit.7dd6d404.Emscripten.clang", type = 3 }} [DEBUG][2024-02-21 23:39:27] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using the compiler selected: remote", type = 3 }} [DEBUG][2024-02-21 23:39:27] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using compiler version: 0.8.19+commit.7dd6d404.Emscripten.clang", type = 3 }} [DEBUG][2024-02-21 23:39:27] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using compiler selected version: v0.8.23+commit.f704f362", type = 3 }} [DEBUG][2024-02-21 23:39:27] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "5333", message = "Source file requires different compiler version (current compiler is 0.8.19+commit.7dd6d404.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version", range = { ["end"] = { character = 23, line = 1 }, start = { character = 0, line = 1 } }, severity = 1 } }, uri = "file:///home/fluffywaffles/dev/work/compound/quark/test/quark-core/EIP712.t.sol" }} [INFO][2024-02-21 23:39:27] ...lsp/handlers.lua:539 "Validating using compiler version: 0.8.19+commit.7dd6d404.Emscripten.clang" [INFO][2024-02-21 23:39:27] ...lsp/handlers.lua:539 "Validating using the compiler selected: remote" [INFO][2024-02-21 23:39:27] ...lsp/handlers.lua:539 "Validating using compiler version: 0.8.19+commit.7dd6d404.Emscripten.clang" [INFO][2024-02-21 23:39:27] ...lsp/handlers.lua:539 "Validating using compiler selected version: v0.8.23+commit.f704f362" [DEBUG][2024-02-21 23:39:29] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using the compiler selected: remote", type = 3 }} [INFO][2024-02-21 23:39:29] ...lsp/handlers.lua:539 "Validating using the compiler selected: remote" [DEBUG][2024-02-21 23:39:29] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using compiler version: 0.8.23+commit.f704f362.Emscripten.clang", type = 3 }} [DEBUG][2024-02-21 23:39:29] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "window/logMessage", params = { message = "Validating using compiler selected version: v0.8.23+commit.f704f362", type = 3 }} [DEBUG][2024-02-21 23:39:29] .../vim/lsp/rpc.lua:387 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = { { code = "9755", message = "Wrong argument count for struct constructor: 0 arguments given but expected 5.", range = { ["end"] = { character = 77, line = 107 }, start = { character = 47, line = 107 } }, severity = 1 } }, uri = "file:///home/fluffywaffles/dev/work/compound/quark/test/quark-core/EIP712.t.sol" }} [INFO][2024-02-21 23:39:29] ...lsp/handlers.lua:539 "Validating using compiler version: 0.8.23+commit.f704f362.Emscripten.clang" [INFO][2024-02-21 23:39:29] ...lsp/handlers.lua:539 "Validating using compiler selected version: v0.8.23+commit.f704f362"
What's interesting to me is the Validating using compiler version
lines, which sometimes say 0.8.23
(yay!) but then it switches to 0.8.19
... It almost seems like a race condition, and 0.8.19
always eventually wins, even if for a short time I get proper diagnostics from 0.8.23
.
I have two project, one with solc
0.8.19
and the other one with solc0.8.21
.First of all, within the project with solc
0.8.19
, I have default extension settings, which means in this workspace, remote and latest compiler will be used. If you run cmdSolidity: get compiler release
, you'll see that the latest is0.8.23
. But if you run cmdSolidity: compiler information
, you'll getCompiler using remote version: 'latest', solidity version: 0.8.19+commit.7dd6d404.Emscripten.clang
. So this is my first question, that the remote latest solc is somehow locked on0.8.19
.Secondly, within the project with solc
0.8.19
, I cannot use goto definition and references, and hover neither. Output ofSolidity language server
said thatWithin the project with solc
0.8.21
, since the latest remote is0.8.19
, I've already changed it to remote0.8.21
instead oflatest
. Hover seems good. But when you want to goto definition or references, the output log said thatAlthough, goto definition or references didn't work for both of projects, their reason seems to be different.