swift-objc-language-server
VSCode extension + Language Server Protocol (LSP) server for Swift and Objective-C files.
Supported features
- Swift (
.swift) and Objective-C (.m, .h, .mm) documents
- Document Symbol (
@ in VSCode quick open): lists symbols for current file
- Go to Definition (
F12 / cmd-click): resolves symbols from open documents, then falls back to full-project scan when needed
- Workspace Symbol (
# in quick open): searches open documents first, then falls back to full-project scan when no match is found
- Quick Symbol Search in Project (editor right-click menu): searches the workspace from the word under cursor and provides jump targets
Current scope intentionally focuses on symbols that are already opened in VSCode.
Architecture
src/extension.ts: VSCode Language Client
src/server.ts: Node-based LSP server
src/symbols.ts: Swift / Objective-C symbol parsing and cursor word extraction
This follows the standard VSCode Language Client + Language Server split architecture.
Install dependencies
npm install
Build
npm run compile
Run in VSCode (manual review)
- Open this repository in VSCode.
- Run
npm run compile.
- Press
F5 to launch an Extension Development Host.
- In the new window, open a Swift or Objective-C file.
- Verify:
Cmd+Shift+O (or quick open with @) shows symbols from current file.
F12 on a symbol jumps to its definition when the defining file is currently open.
Package and install in local VSCode
- Install VSCE:
npm install -D @vscode/vsce
- Create VSIX:
npx vsce package
- Install VSIX:
code --install-extension swift-objc-language-server-0.1.0.vsix
| |