Skip to content

Latest commit

 

History

History
98 lines (83 loc) · 7.09 KB

File metadata and controls

98 lines (83 loc) · 7.09 KB

Features

  • Go to Definition / Go to Declaration — jump to any symbol across files, including qualifier segments in qualified type paths (e.g., Pool in Pool.State navigates to the contract/library)
  • Find References — all usages of a symbol across the project, including qualified type path references (e.g., Pool in Pool.State); interface/implementation equivalence merges references across interface declarations and their implementing functions
  • Rename — project-wide symbol rename with prepare support, including qualifier usages in qualified type paths
  • Hover — signatures, NatSpec docs, function/error/event selectors, @inheritdoc resolution, AST node ID for debugging
  • Completions — scope-aware with two modes (fast cache vs full recomputation)
  • Document Links — clickable imports, type names, function calls
  • Document Symbols / Workspace Symbols — outline and search
  • Formatting — via forge fmt
  • Diagnostics — from solc and forge lint
  • Signature Help — parameter info on function calls, event emits, and mapping access
  • Inlay Hints — parameter names at call sites
  • File Operationsworkspace/willCreateFiles scaffolding + workspace/willRenameFiles/workspace/willDeleteFiles import edits + workspace/didCreateFiles/workspace/didRenameFiles/workspace/didDeleteFiles cache migration/re-index (fileOperations.templateOnCreate, fileOperations.updateImportsOnRename, fileOperations.updateImportsOnDelete)
  • Go to Implementation — jump from interface/abstract declarations to their concrete implementations; supports functions, modifiers, and state variables with baseFunctions/baseModifiers
  • Call HierarchytextDocument/prepareCallHierarchy, callHierarchy/incomingCalls, callHierarchy/outgoingCalls — navigate call graphs across contracts and libraries; tracks function calls, modifier invocations, and base constructor specifiers with narrow call-site ranges; incoming calls include callers via interface-typed references
  • Code ActionstextDocument/codeAction quickfix engine; handles unused-import forge-lint diagnostic with "Remove unused import" action; JSON-driven rule table in data/error_codes.json
  • Execute Commandssolidity.clearCache (wipe on-disk cache + all in-memory caches, full reset) · solidity.reindex (evict in-memory AST, trigger background reindex from warm disk cache)
  • Update Check — checks GitHub releases on startup and notifies via window/showMessage when a newer version is available (checkForUpdates setting, default: true)
  • Save Performance — content hash check skips redundant solc rebuilds when file is unchanged; collect_import_pragmas runs on blocking thread pool to avoid stalling the async runtime on large projects

See FEATURES.md for the full LSP feature set and roadmap.

LSP Methods

General

  • initialize - Server initialization
  • initialized - Server initialized notification
  • shutdown - Server shutdown

Text Synchronization

  • textDocument/didOpen - Handle file opening
  • textDocument/didChange - Handle file content changes
  • textDocument/didSave - Handle file saving with diagnostics refresh
  • textDocument/didClose - Handle file closing
  • textDocument/willSave - File will save notification
  • textDocument/willSaveWaitUntil - File will save wait until

Diagnostics

  • textDocument/publishDiagnostics - Publish compilation errors and warnings via forge build
  • textDocument/publishDiagnostics - Publish linting errors and warnings via forge lint

Language Features

  • textDocument/definition - Go to definition
  • textDocument/declaration - Go to declaration
  • textDocument/references - Find all references
  • textDocument/documentSymbol - Document symbol outline (contracts, functions, variables, events, structs, enums, etc.)
  • textDocument/prepareRename - Prepare rename validation
  • textDocument/rename - Rename symbols across files
  • textDocument/formatting - Document formatting
  • textDocument/completion - Code completion
  • textDocument/hover - Hover information
  • textDocument/signatureHelp - Function signature help (functions, events, mappings)
  • textDocument/prepareCallHierarchy - Prepare call hierarchy (resolve callable at cursor)
  • callHierarchy/incomingCalls - Find all callers of a function/modifier/contract
  • callHierarchy/outgoingCalls - Find all callees from a function/modifier/contract (includes low-level .call()/.staticcall()/.delegatecall() and Yul call opcodes)
  • textDocument/typeDefinition - Go to type definition
  • textDocument/implementation - Go to implementation (interface → concrete implementations via baseFunctions)
  • textDocument/documentHighlight - Document highlighting (read/write classification)
  • textDocument/codeAction - Code actions (unused-import quickfix via forge-lint diagnostics)
  • textDocument/codeLens - Code lens
  • textDocument/documentLink - Document links (clickable references and import paths)
  • textDocument/documentColor - Color information
  • textDocument/colorPresentation - Color presentation
  • textDocument/rangeFormatting - Range formatting
  • textDocument/onTypeFormatting - On-type formatting
  • textDocument/foldingRange - Folding ranges (contracts, functions, structs, enums, blocks, comments, imports)
  • textDocument/selectionRange - Selection ranges
  • textDocument/inlayHint - Inlay hints (parameter names)
  • textDocument/semanticTokens - Semantic tokens
  • textDocument/semanticTokens/full - Full semantic tokens
  • textDocument/semanticTokens/range - Range semantic tokens
  • textDocument/semanticTokens/delta - Delta semantic tokens

Workspace Features

  • workspace/symbol - Workspace-wide symbol search
  • workspace/didChangeConfiguration - Updates editor settings (inlay hints, lint options)
  • workspace/didChangeWatchedFiles - Acknowledges watched file changes (logs only)
  • workspace/didChangeWorkspaceFolders - Acknowledges workspace folder changes (logs only)
  • workspace/applyEdit - Inbound handler not implemented (server uses outbound workspace/applyEdit to scaffold created files)
  • workspace/executeCommand - Execute workspace commands (solidity.clearCache, solidity.reindex)
  • workspace/willCreateFiles - File creation preview (scaffolding for .sol, .t.sol, .s.sol)
  • workspace/didCreateFiles - Post-create scaffold fallback + cache/index refresh
  • workspace/willRenameFiles - File rename preview (import path updates)
  • workspace/didRenameFiles - Post-rename cache migration + background re-index
  • workspace/willDeleteFiles - File deletion preview (removes imports to deleted files)
  • workspace/didDeleteFiles - Post-delete cache cleanup + background re-index

Window Features

  • window/showMessage - Show message to user
  • window/showMessageRequest - Show message request to user
  • window/workDoneProgress - Work done progress