Skip to content

Commit

Permalink
LSP server development (#14)
Browse files Browse the repository at this point in the history
* Add server-side LSP development support

* Clean up ProtocolHandler

* Replace print with usage of error stream

* Fix workflow

* Remove logging dependency

* Remove ProtocolHandler

* Rename to LSPClient/LSPServer

* Remove unused task

* Send empty result for requests without response

All requests need to respond, otherwise it is a notification, not a request

* Restore initializer

* Fix spelling

* Fix copy-paste error

* Fix spelling
  • Loading branch information
koliyo authored Nov 17, 2023
1 parent a80b021 commit cddb5bd
Show file tree
Hide file tree
Showing 18 changed files with 1,178 additions and 279 deletions.
4 changes: 2 additions & 2 deletions .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 -destination "${{ matrix.destination }}" test | xcpretty
run: set -o pipefail && xcodebuild -scheme LanguageServerProtocol-Package -destination "${{ matrix.destination }}" test | xcpretty

linux_test:
name: Test Linux
Expand All @@ -42,4 +42,4 @@ jobs:
- name: Install the latest Swift toolchain
run: swiftly install latest
- name: Test
run: swift test
run: swift test
24 changes: 11 additions & 13 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"object": {
"pins": [
{
"package": "JSONRPC",
"repositoryURL": "https://github.com/ChimeHQ/JSONRPC",
"state": {
"branch": null,
"revision": "1ae27fceaec3208f62b3ef23d2d565d4222c3ac6",
"version": "0.8.1"
}
"pins" : [
{
"identity" : "jsonrpc",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ChimeHQ/JSONRPC",
"state" : {
"revision" : "c6ec759d41a76ac88fe7327c41a77d9033943374",
"version" : "0.9.0"
}
]
},
"version": 1
}
],
"version" : 2
}
20 changes: 18 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,33 @@ let package = Package(
.library(
name: "LanguageServerProtocol",
targets: ["LanguageServerProtocol"]),

.library(
name: "LSPClient",
targets: ["LSPClient"]),

.library(
name: "LSPServer",
targets: ["LSPServer"]),
],
dependencies: [
.package(url: "https://github.com/ChimeHQ/JSONRPC", "0.8.0"..<"0.9.0"),
.package(url: "https://github.com/ChimeHQ/JSONRPC", from: "0.9.0"),

],
targets: [
.target(
name: "LanguageServerProtocol",
dependencies: ["JSONRPC"]),
.target(
name: "LSPClient",
dependencies: ["LanguageServerProtocol"]),
.target(
name: "LSPServer",
dependencies: ["LanguageServerProtocol"]),

.testTarget(
name: "LanguageServerProtocolTests",
dependencies: ["LanguageServerProtocol"]),
dependencies: ["LanguageServerProtocol", "LSPClient"]),
]
)

Expand Down
Loading

0 comments on commit cddb5bd

Please sign in to comment.