Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Swift/C/Objective-C Language ServerNew to Visual Studio Code? Get it now.
Swift/C/Objective-C Language Server

Swift/C/Objective-C Language Server

VictorChen

|
87 installs
| (0) | Free
Swift, C, Objective-C, and Objective-C++ language server + VS Code extension
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Swift/C/Objective-C Language Server

Ultra-lightweight VS Code extension + Language Server Protocol (LSP) server for Swift, C, Objective-C, and Objective-C++ files.

Supported features

  • Swift (.swift), C (.c), Objective-C (.m, .h), Objective-C++ (.mm), non-template C++ (.cpp, .hpp, etc.) and Xcode build settings (.xcconfig). Full compiler/type-system semantics are not provided.
  • Document Symbol (@ in VSCode quick open): lists symbols for current file
  • Breadcrumb symbol path: shows the current Swift / Objective-C class and function or method in the editor path bar when Breadcrumbs are enabled
  • Go to Definition (F12 / cmd-click): uses case-sensitive declarations, then cached project-source lookup and bundled Swift / Objective-C references. Tab never resolves to an unrelated tab. Explicit SwiftUI.Type references navigate directly; unqualified project declarations retain priority, even in unopened files. The extension's F12 command waits for definition lookup to finish and can explain a missing definition when swiftObjcLanguageServer.definitionFallback.enabled is enabled; automatic definition-provider requests and Ctrl/Cmd-click never open documentation automatically.
  • Swift receiver navigation: typed/constructed/optional/generic receivers, self/super, known-return method-call chains, inheritance, cross-file extensions, aliases and nested types. Call-site labels, defaults, variadics, trailing closures and supported known argument types filter overloads; genuine ambiguity remains available to Peek. Unknown owners or conflicting return types stop inference rather than selecting unrelated declarations.
  • ObjC owner/selector navigation: complete selectors and class/instance receivers; matching headers/implementations; categories, protocols and superclasses; property chains, explicit/synthesized ivars, object typedefs, typed/instancetype results and bounded straight-line id/Class flow. Supported selector literals require a reliable receiver/target. Explicit Swift/ObjC exports and configured bridging-header imports have conservative navigation projections; arbitrary importer renames and dynamic flow remain unsupported.
  • Go to Type Definition: supported Swift binding/expression types and explicitly typed ObjC/ObjC++ object/protocol bindings. F12 on geo still returns its lexical declaration; type definition reaches GeometryProxy. Constructor/callback signatures provide supported untyped closure inputs without App annotations. See closure/type navigation and limits.
  • Swift bindings: callable/initializer/closure parameters, argument-label anchors, optional if/while/guard bindings, loops, tuple destructuring, supported enum payloads and collection closure inputs including $0. Lexical visibility and initializer exclusions prevent bindings from leaking into failure branches or outer scopes.
  • SwiftUI component assets: 94 standard components/support types have offline navigation references in assets/swiftui-{components,navigation,state}-stubs.swift, including Tab, Text, Image, Button, stacks/grids, navigation, shapes and state wrappers. Each includes a summary, representative declarations and an official link. The component catalog is shared with the static preview; project custom components still win. These are navigation-only references, not compiled SDK implementations or Apple artwork.
  • SwiftUI modifiers: 48 representative local signatures in assets/swiftui-view-modifiers-stubs.swift, including .padding, .frame, .foregroundStyle, backgrounds, gestures and presentation. Known View owner chains are required; real project members win. These references do not reproduce all SDK overloads or availability.
  • Project inputs: bounded SwiftPM literal target paths, source-directory modules, module maps and uniquely known Xcode module settings support import/qualification filtering. .xcconfig settings/compilation flags and existing workspace-local generated directories provide definitions without running build scripts.
  • Swift stdlib / convenience references: F12 on supported map, filter, compactMap, flatMap, sorted, first(where:), allSatisfy, reduce, etc. opens swift-stdlib-stubs.swift with usage examples and caveats. Illustrative helpers such as grouped, chunked, uniqued and clamped are explicitly marked not standard SDK methods; implement/import them in your project before use.
  • UIKit / Foundation / CoreGraphics references: 54 top-level Swift types and 301 representative member anchors in assets/{uikit,foundation,coregraphics}-stubs.swift, including UISegmentedControl, UIColor, UIFont, UIScreen, UIView, NSAttributedString.Key and geometry types. Direct imports and iOS-oriented SwiftUI re-exports support offline F12 / Ctrl-click, inherited appearance() chains and explicit UIKit.Type names. Selective imports remain restricted; project namesakes, aliases and matching extensions retain priority. These are navigation references, not a complete SDK or a platform-availability guarantee. See UIKit navigation verification.
  • Objective-C/Foundation stubs: F12 on common Objective-C / Foundation / UIKit symbols such as NSObject, NSString, NSArray, NSDictionary, UIView, UIViewController, UISegmentedControl, UIColor, UIFont, NSLog, and dispatch helpers opens bundled local reference stubs
  • 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
  • Quick Reference Search in Project (Cmd+Alt+R / Ctrl+Alt+R, or editor right-click menu): finds up to 120 usages of the symbol under the cursor across the workspace. Local bindings respect visibility/shadowing; known Swift receiver and ObjC full-selector references are filtered by resolved declaration identity, backed by a bounded disk occurrence reverse index. Unresolved usages are not claimed complete; a single match jumps directly, multiple matches open VS Code's inline Peek view
  • Explain Unknown Symbol (editor right-click menu / Command Palette): explicitly looks up official Apple Developer documentation for the selected symbol, even if a local definition exists. Go to Definition or Explain Symbol offers source navigation first with explicit documentation fallback.
  • Preview SwiftUI Layout (Beta) (Swift editor right-click menu / Command Palette): visual-only, bounded static SwiftUI preview. It renders the View or #Preview at the editor cursor, automatically opens a sole available root or prompts you to choose when there are multiple, can pair discoverable custom Views across workspace Swift files, and shows supported components in a VS Code Webview. It does not run or launch the app; native controls and runtime-dependent components are approximations or placeholders, not interactive app controls or pixel-parity output.

This is a lightweight heuristic resolver, not compiler-level semantic analysis. Project scans are bounded (5,000 candidate files per root, 512 KiB per source); dynamic/cross-language ObjC typing, C++ templates, complex Swift inference and project module ownership remain limited. See navigation reuse audit for the Kotlin/Java changes adapted here and remaining work.

Offline API guides

All nine reference files include English API-level explanations, practical examples, API-specific restrictions and links, including when to configure appearance(), state ownership, optional/error behavior, units and Unicode indexing. They remain abbreviated navigation references, not runnable SDK implementations. Owned extension reference copies are not treated as application source; identical F12 selections are deduplicated without hiding genuine overloads or other owners.

Coverage and the non-comment-code preservation gate: stub documentation audit. Maintainers can run npm run docs:audit; after reviewing changes to scripts/stub-guides-*.cjs, regenerate with node scripts/document-stubs.cjs . --apply and run npm test.

iOS workspace audits

  • Bianca iOS
  • Motoko iOS
  • Patricia iOS

Architecture

  • src/extension.ts: VSCode Language Client
  • src/server.ts: Node-based LSP server
  • src/symbols.ts: Swift and C-family declaration entry points, code-occurrence indexing, and cursor word extraction
  • src/swiftSymbols.ts: balanced Swift declaration/parameter parsing and lexical binding metadata
  • src/swiftBindings.ts / src/navigationSyntax.ts: conditional/pattern/closure bindings and shared bounded expression coordinates
  • src/swiftMemberResolution.ts: owner-first expression inference, generic substitution and call matching
  • src/swiftBuiltinModules.ts: shared offline framework references, import visibility and bounded iOS re-exports
  • src/objcSymbols.ts: balanced ObjC owners, selectors, typed bindings and declaration locations
  • src/objcMemberResolution.ts: owner-first ObjC message/property, protocol and superclass lookup
  • src/bridgeNavigation.ts / src/cppNavigation.ts: conservative cross-language projections and non-template C++ owners
  • src/projectNavigation.ts / src/occurrenceFileIndex.ts: read-only project/build metadata and bounded reverse occurrence index

This follows the standard VSCode Language Client + Language Server split architecture.

Install dependencies

npm install

Build

npm run compile

Run in VSCode (manual review)

  1. Open this repository in VSCode.
  2. Run npm run compile.
  3. Press F5 to launch an Extension Development Host.
  4. In the new window, open a Swift, C, or Objective-C file.
  5. Verify:
    • Cmd+Shift+O (or quick open with @) shows symbols from current file.
    • Breadcrumbs show the current symbol path for Swift and Objective-C files when breadcrumbs.enabled is on.
    • F12 on a symbol jumps to its definition when the defining file is currently open.
    • In a Swift file, place the cursor inside a SwiftUI View or #Preview, then run Swift ObjC Language Server: Preview SwiftUI Layout from the editor context menu or Command Palette. If the cursor is outside a declaration, the sole root opens directly; when multiple roots are available, choose one from the picker. The panel follows the cursor and refreshes as source changes.

SwiftUI Static Preview — 0.3.0 Beta

This feature is a visual-only static preview, not a running SwiftUI app. Place the editor cursor in a View, #Preview, or computed View section and run Preview SwiftUI Layout. If no declaration contains the cursor, the sole available root opens directly; when multiple roots are available, choose one from the picker. The preview discovers and pairs uniquely matched custom Views in the workspace, then refreshes as source changes.

The bounded V2 engine uses a measure → layout → paint pipeline inside a VS Code Webview. It does not compile or execute workspace Swift, launch Xcode or a Simulator, run app lifecycle code or button callbacks, invoke Binding setters/UIKit, or fetch network content. Native controls are drawn for appearance only: clicking a preview node opens its source; it does not perform the app action. The viewport, color scheme, zoom, source-following, and static branch-selection controls belong to the preview panel and do not change app state.

The panel includes phone, tablet, landscape-phone, and iPad Pro 13-inch logical-point viewports (1032×1376 portrait / 1376×1032 landscape), a layout inspector, source navigation, and diagnostics. Known literals and bounded source values are shown where supported. Runtime-dependent values that cannot be resolved stay marked unknown or sampled; they are not evidence of the running app's state. Unsupported components retain a visible placeholder where possible. Remote images are not fetched; UIKit and platform-specific runtime behavior is not executed or guaranteed to match.

Credential warning: SecureField text is visually masked in the rendered control, but preview data is not a secret-redaction boundary. Do not put real passwords, tokens, or other sensitive values in source being previewed.

The beta is not an Xcode Canvas/Simulator capture or a promise of Apple SwiftUI pixel parity. Swift syntax, system typography/SF Symbols/materials, native control details, complex layouts, and runtime-driven content may differ. Review the support matrix and V2 audit/known limitations before relying on a component.

For repeatable static regression checks (not native-app visual comparison):

npm test
npm run preview:harness -- --workspace /path/to/swiftui-project
npm run preview:harness:chrome -- --workspace /path/to/swiftui-project

The harness screenshots exercise the static renderer in Chromium; they do not prove the native app or VS Code Webview matches SwiftUI. See docs/preview-fixtures.md, docs/preview-heuristics.md, and docs/swiftui-parser-spike.md for development fixtures, supported approximations, and parser notes.

Package and install in local VSCode

  1. Install VSCE:

    npm install -D @vscode/vsce
    
  2. Create VSIX:

    npx vsce package --allow-missing-repository
    

    Do not pass --no-dependencies: the extension loads vscode-languageclient at runtime and the dependency must be included in the VSIX.

  3. Install VSIX:

    code --install-extension swift-objc-language-server-0.3.8.vsix
    
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft