Skip to content

Commit b85ff77

Browse files
committed
Edit README
1 parent b799bc1 commit b85ff77

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SwiftLSP offers a quite dynamic Swift representation of the [LSP (Language Serve
88

99
Since the LSP standard defines a complex amorphous multitude of valid JSON objects, it doesn't exactly lend itself to being represented as a strict type system that would mirror the standard down to every permutation and property. So SwiftLSP is strictly typed at the higher level of LSP messages but falls back onto a more dynamic and flexible JSON representation for the details. The strict typing can easily be expanded on client demand.
1010

11-
## Code Examples
11+
## How?
1212

1313
Some of these examples build upon preceding ones, so it's best to read them from the beginning.
1414

@@ -33,7 +33,7 @@ let myRequestMessageDecoded = try LSP.Message(myRequestMessageEncoded)
3333

3434
### Wrap Messages in Packets
3535

36-
To send LSP messages via data channels, the standard defines how to [wrap each message](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#baseProtocol) in what we call an `LSP.Packet`, which holds the `Data` of its `header`- an `content` part.
36+
To send LSP messages via data channels, the standard defines how to [wrap each message](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#baseProtocol) in what we call an `LSP.Packet`, which holds the `Data` of its `header`- and `content` part.
3737

3838
```swift
3939
let myRequestMessagePacket = try LSP.Packet(myRequestMessage)
@@ -48,7 +48,7 @@ let packetTotalData = myRequestMessagePacket.data // Data
4848
let myRequestMessageUnpacked = try myRequestMessagePacket.message() // LSP.Message
4949
```
5050

51-
### Extract LSP Packets From Data
51+
### Extract Packets From Data
5252

5353
A client talking to an LSP server might need to extract `LSP.Packet`s from the server's output `Data` stream.
5454

@@ -81,9 +81,10 @@ for byte in dataStartingWithPacket {
8181

8282
Beyond what the examples above have touched, SwiftLSP also helps with:
8383

84+
* Creating messages for specific use cases (initialize server, request symbols, request references ...)
8485
* Launching an LSP server executable
8586
* Matching response messages to request messages
86-
* Making requests to an LSP Server through `async` **functions**
87+
* Making requests to an LSP Server through `async` functions
8788
* Using an LSP Server via WebSocket
8889

8990
## Architecture

0 commit comments

Comments
 (0)