Skip to content

Commit 48a7fd6

Browse files
Remove completion example
1 parent 336cab0 commit 48a7fd6

File tree

1 file changed

+0
-63
lines changed

1 file changed

+0
-63
lines changed

CodeEdit/Features/LSP/Service/LSPService.swift

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -34,69 +34,6 @@ import CodeEditLanguages
3434
/// )
3535
/// try await lspService.stopServer(for: .python)
3636
/// ```
37-
///
38-
/// ## Completion Example
39-
///
40-
/// ```swift
41-
/// func testCompletion() async throws {
42-
/// do {
43-
/// guard var languageClient = self.languageClient(for: .python) else {
44-
/// print("Failed to get client")
45-
/// throw ServerManagerError.languageClientNotFound
46-
/// }
47-
///
48-
/// let testFilePathStr = ""
49-
/// let testFileURL = URL(fileURLWithPath: testFilePathStr)
50-
///
51-
/// // Tell server we opened a document
52-
/// _ = await languageClient.addDocument(testFileURL)
53-
///
54-
/// // Completion example
55-
/// let textPosition = Position(line: 32, character: 18) // Lines and characters start at 0
56-
/// let completions = try await languageClient.requestCompletion(
57-
/// document: testFileURL.absoluteString,
58-
/// position: textPosition
59-
/// )
60-
/// switch completions {
61-
/// case .optionA(let completionItems):
62-
/// // Handle the case where completions is an array of CompletionItem
63-
/// print("\n*******\nCompletion Items:\n*******\n")
64-
/// for item in completionItems {
65-
/// let textEdits = LSPCompletionItemsUtil.getCompletionItemEdits(
66-
/// startPosition: textPosition,
67-
/// item: item
68-
/// )
69-
/// for edit in textEdits {
70-
/// print(edit)
71-
/// }
72-
/// }
73-
///
74-
/// case .optionB(let completionList):
75-
/// // Handle the case where completions is a CompletionList
76-
/// print("\n*******\nCompletion Items:\n*******\n")
77-
/// for item in completionList.items {
78-
/// let textEdits = LSPCompletionItemsUtil.getCompletionItemEdits(
79-
/// startPosition: textPosition,
80-
/// item: item
81-
/// )
82-
/// for edit in textEdits {
83-
/// print(edit)
84-
/// }
85-
/// }
86-
///
87-
/// print(completionList.items[0])
88-
///
89-
/// case .none:
90-
/// print("No completions found")
91-
/// }
92-
///
93-
/// // Close the document
94-
/// _ = await languageClient.closeDocument(testFilePathStr)
95-
/// } catch {
96-
/// print(error)
97-
/// }
98-
/// }
99-
/// ```
10037
@MainActor
10138
final class LSPService: ObservableObject {
10239
let logger: Logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "", category: "LSPService")

0 commit comments

Comments
 (0)