<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XcodeKit",
  "identifier" : "/documentation/XcodeKit/XCSourceEditorExtension",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "XcodeKit"
    ],
    "preciseIdentifier" : "c:objc(pl)XCSourceEditorExtension"
  },
  "title" : "XCSourceEditorExtension"
}
-->

# XCSourceEditorExtension

The protocol you implement to create Xcode source editor extensions.

```
protocol XCSourceEditorExtension : NSObjectProtocol
```

## Overview

There are no guarantees about the thread or queue on which any Xcode Source Editor Extension methods are executed, including the designated initializer.

## Topics

### Defining Extension Commands

[`var commandDefinitions: [[XCSourceEditorCommandDefinitionKey : Any]]`](/documentation/XcodeKit/XCSourceEditorExtension/commandDefinitions)

The array of command definitions used by Xcode to associate command names with their implementation in an extension.

### Handling Extension Launches

[`func extensionDidFinishLaunching()`](/documentation/XcodeKit/XCSourceEditorExtension/extensionDidFinishLaunching())

Tells the extension that it successfully launched and may begin to receive editor commands.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)