Skip to content

Commit 3ce1a3c

Browse files
committed
File Name Cleanup, Remove internal
1 parent 1958b33 commit 3ce1a3c

26 files changed

+152
-149
lines changed

CodeEdit.xcodeproj/project.pbxproj

Lines changed: 100 additions & 93 deletions
Large diffs are not rendered by default.

CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CodeEdit/Features/LSP/LSPEventHandler.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import LanguageServerProtocol
1010

1111
extension LSPService {
1212

13-
internal func startListeningToEvents(for languageId: LanguageIdentifier) {
13+
func startListeningToEvents(for languageId: LanguageIdentifier) {
1414
guard let languageClient = languageClients[languageId] else {
1515
logger.error("Language client not found for \(languageId.rawValue)")
1616
return
@@ -25,7 +25,7 @@ extension LSPService {
2525
eventListeningTasks[languageId] = task
2626
}
2727

28-
internal func stopListeningToEvents(for languageId: LanguageIdentifier) {
28+
func stopListeningToEvents(for languageId: LanguageIdentifier) {
2929
if let task = eventListeningTasks[languageId] {
3030
task.cancel()
3131
eventListeningTasks.removeValue(forKey: languageId)

CodeEdit/Features/LSP/LSPService.swift

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,41 @@ import Foundation
1111
import LanguageClient
1212
import LanguageServerProtocol
1313

14-
/**
15-
`LSPService` is a service class responsible for managing the lifecycle and event handling
16-
of Language Server Protocol (LSP) clients within the CodeEdit application. It handles the initialization,
17-
communication, and termination of language servers, ensuring that code assistance features
18-
such as code completion, diagnostics, and more are available for various programming languages.
19-
20-
This class uses Swift's concurrency model to manage background tasks and event streams
21-
efficiently. Each language server runs in its own asynchronous task, listening for events and
22-
handling them as they occur. The `LSPService` class also provides functionality to start
23-
and stop individual language servers, as well as to stop all running servers.
24-
25-
## Example Usage
26-
```swift
27-
@Service var lspService
28-
29-
try await lspService.startServer(
30-
for: .python,
31-
projectURL: projectURL,
32-
workspaceFolders: workspaceFolders
33-
)
34-
try await lspService.stopServer(for: .python)
35-
```
36-
*/
14+
/// `LSPService` is a service class responsible for managing the lifecycle and event handling
15+
/// of Language Server Protocol (LSP) clients within the CodeEdit application. It handles the initialization,
16+
/// communication, and termination of language servers, ensuring that code assistance features
17+
/// such as code completion, diagnostics, and more are available for various programming languages.
18+
///
19+
/// This class uses Swift's concurrency model to manage background tasks and event streams
20+
/// efficiently. Each language server runs in its own asynchronous task, listening for events and
21+
/// handling them as they occur. The `LSPService` class also provides functionality to start
22+
/// and stop individual language servers, as well as to stop all running servers.
23+
///
24+
/// ## Example Usage
25+
/// ```swift
26+
/// @Service var lspService
27+
///
28+
/// try await lspService.startServer(
29+
/// for: .python,
30+
/// projectURL: projectURL,
31+
/// workspaceFolders: workspaceFolders
32+
/// )
33+
/// try await lspService.stopServer(for: .python)
34+
/// ```
3735
final class LSPService: ObservableObject {
36+
let logger: Logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "", category: "LSPService")
3837

39-
internal let logger: Logger
4038
/// Holds the active language clients
41-
internal var languageClients: [LanguageIdentifier: LanguageServer] = [:]
39+
var languageClients: [LanguageIdentifier: LanguageServer] = [:]
4240
/// Holds the language server configurations for all the installed language servers
43-
internal var languageConfigs: [LanguageIdentifier: LanguageServerBinary] = [:]
41+
var languageConfigs: [LanguageIdentifier: LanguageServerBinary] = [:]
4442
/// Holds all the event listeners for each active language client
45-
internal var eventListeningTasks: [LanguageIdentifier: Task<Void, Never>] = [:]
43+
var eventListeningTasks: [LanguageIdentifier: Task<Void, Never>] = [:]
4644

4745
@AppSettings(\.developerSettings.lspBinaries)
48-
internal var lspBinaries
46+
var lspBinaries
4947

5048
init() {
51-
self.logger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "", category: "LSPService")
52-
5349
// Load the LSP binaries from the developer menu
5450
for binary in lspBinaries {
5551
if let language = LanguageIdentifier(rawValue: binary.key) {

CodeEdit/Features/LSP/LanguageClient/LanguageClient+CallHierarchy.swift renamed to CodeEdit/Features/LSP/LanguageServer+/LanguageServer+CallHierarchy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// LanguageClient+CallHierarchy.swift
2+
// LanguageServer+CallHierarchy.swift
33
// CodeEdit
44
//
55
// Created by Abe Malla on 2/7/24.

CodeEdit/Features/LSP/LanguageClient/LanguageClient+ColorPresentation.swift renamed to CodeEdit/Features/LSP/LanguageServer+/LanguageServer+ColorPresentation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// LanguageClient+ColorPresentation.swift
2+
// LanguageServer+ColorPresentation.swift
33
// CodeEdit
44
//
55
// Created by Abe Malla on 2/7/24.

CodeEdit/Features/LSP/LanguageClient/LanguageClient+Completion.swift renamed to CodeEdit/Features/LSP/LanguageServer+/LanguageServer+Completion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// LanguageClient+Completion.swift
2+
// LanguageServer+Completion.swift
33
// CodeEdit
44
//
55
// Created by Abe Malla on 2/7/24.

CodeEdit/Features/LSP/LanguageClient/LanguageClient+Declaration.swift renamed to CodeEdit/Features/LSP/LanguageServer+/LanguageServer+Declaration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// LanguageClient+Declaration.swift
2+
// LanguageServer+Declaration.swift
33
// CodeEdit
44
//
55
// Created by Abe Malla on 2/7/24.

CodeEdit/Features/LSP/LanguageClient/LanguageClient+Definition.swift renamed to CodeEdit/Features/LSP/LanguageServer+/LanguageServer+Definition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// LanguageClient+Definition.swift
2+
// LanguageServer+Definition.swift
33
// CodeEdit
44
//
55
// Created by Abe Malla on 2/7/24.

CodeEdit/Features/LSP/LanguageClient/LanguageClient+Diagnostics.swift renamed to CodeEdit/Features/LSP/LanguageServer+/LanguageServer+Diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// LanguageClient+Diagnostics.swift
2+
// LanguageServer+Diagnostics.swift
33
// CodeEdit
44
//
55
// Created by Abe Malla on 2/7/24.

0 commit comments

Comments
 (0)