Skip to content

Commit

Permalink
Moving server stuff out to LanguageServer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Nov 30, 2023
1 parent af169ca commit 6f5b63a
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 763 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test platform ${{ matrix.destination }}
run: set -o pipefail && xcodebuild -scheme LanguageServerProtocol-Package -destination "${{ matrix.destination }}" test | xcpretty
run: set -o pipefail && xcodebuild -scheme LanguageServerProtocol -destination "${{ matrix.destination }}" test | xcpretty

linux_test:
name: Test Linux
Expand Down
5 changes: 0 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ let package = Package(
platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)],
products: [
.library(name: "LanguageServerProtocol", targets: ["LanguageServerProtocol"]),
.library(name: "LSPServer", targets: ["LSPServer"]),
],
dependencies: [
.package(url: "https://github.com/ChimeHQ/JSONRPC", from: "0.9.0"),
Expand All @@ -17,10 +16,6 @@ let package = Package(
.target(
name: "LanguageServerProtocol",
dependencies: ["JSONRPC"]),
.target(
name: "LSPServer",
dependencies: ["LanguageServerProtocol"]),

.testTarget(
name: "LanguageServerProtocolTests",
dependencies: ["LanguageServerProtocol"]),
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

This is a Swift library for interacting with [Language Server Protocol](https://microsoft.github.io/language-server-protocol/). It contains type definitions and utilities useful for both server- and client-side projects.

If you are looking for a way to interact with servers, you probably want to use the higher-level [LanguageClient](https://github.com/ChimeHQ/LanguageClient).
Need to interact with servers? You may want to take a look at [LanguageClient](https://github.com/ChimeHQ/LanguageClient).
Want to build a server? Check out [LanguageServer](https://github.com/ChimeHQ/LanguageServer).

## Typing Approach

Expand All @@ -21,11 +22,6 @@ This library models these cases using nested structures and/or the `TwoTypeOptio

## Integration

This library comes with 2 distinct parts:

- `LanguageServerProtocol`: Core types and behaviors.
- `LSPServer` server functionality (for implementing servers)

```swift
dependencies: [
.package(url: "https://github.com/ChimeHQ/LanguageServerProtocol", from: "0.11.0")
Expand All @@ -36,12 +32,19 @@ dependencies: [

For the most part, this library strives to be a straightforward version of the spec in Swift. There are a few places, however, where it just makes sense to pull in some extra functionality.

- `MockServer`: a stand-in that is useful for mocking a real server
- `Server`: a protocol that describes the essential server functionality
- `Snippet`: makes it easier to interpret the contents of completion results
- `TokenRepresentation`: maintains the state of a document's semantic tokens
- `DataChannel.withMessageFraming`: wraps an existing JSONRPC DataChannel up with HTTP header-based message framing

## Client Support

Right now, there are still some bits useful for client support in this library:

- `MockServer`: a stand-in that is useful for mocking a real server
- `Server`: a protocol that describes the essential server functionality

The intention is to migrate all of these out into LanguageClient, leaving this library purely focused on protocol-level support.

## Supported Features

The LSP [specification](https://microsoft.github.io/language-server-protocol/specification) is large, and this library currently does not implement it all. The intention is to support the 3.x specification, but be as backwards-compatible as possible with pre-3.0 servers.
Expand Down
12 changes: 0 additions & 12 deletions Sources/LSPServer/Server.ClientConnection.swift

This file was deleted.

3 changes: 0 additions & 3 deletions Sources/LSPServer/Server.ErrorHandler.swift

This file was deleted.

39 changes: 0 additions & 39 deletions Sources/LSPServer/Server.EventDispatcher.swift

This file was deleted.

2 changes: 0 additions & 2 deletions Sources/LSPServer/Server.EventHandler.swift

This file was deleted.

Loading

0 comments on commit 6f5b63a

Please sign in to comment.