@@ -4,15 +4,15 @@ A language server wrapper for the `@neo4j-cypher/language-support` package.
4
4
5
5
## Installation
6
6
7
- We will provide a quick way to install the serer via npm soon™️. For now you can build it yourself, see instructions below.
7
+ You can install the language server using npm:
8
8
9
- ### Bundling and usage from typescript
9
+ ```
10
+ npm i -g @neo4j-cypher/language-server
11
+ ```
10
12
11
- To package the language server into a single javascript bundle, go to the root of the project and
12
- do ` npm run build ` .
13
- After that a file ` ./packages/language-server/dist/cypher-language-server.js ` will be generated.
13
+ ### Usage
14
14
15
- You can run the language server with ` node ./ cypher-language-server.js --stdio` .
15
+ Once installed, you can run the language server using ` cypher-language-server --stdio ` .
16
16
17
17
Below you can find a few examples in Typescript on how to send messages to that server.
18
18
@@ -21,9 +21,7 @@ Below you can find a few examples in Typescript on how to send messages to that
21
21
``` typescript
22
22
import * as child_process from ' child_process' ;
23
23
24
- let lspProcess = child_process .fork (' cypher-language-server.js' , [
25
- ' --node-ipc' ,
26
- ]);
24
+ let lspProcess = child_process .spawn (' cypher-language-server' , [' --ipc' ]);
27
25
let messageId = 1 ;
28
26
29
27
function send(method : string , params : object ) {
@@ -99,7 +97,7 @@ const server = net.createServer((socket: net.Socket) => {
99
97
});
100
98
101
99
server .listen (3000 , () => {
102
- child_process .spawn (' node ' , [ ' cypher-language-server.js ' , ' --socket=3000' ]);
100
+ child_process .spawn (' cypher-language-server' , [ ' --socket=3000' ]);
103
101
});
104
102
```
105
103
@@ -109,10 +107,7 @@ server.listen(3000, () => {
109
107
import * as child_process from ' child_process' ;
110
108
import * as rpc from ' vscode-jsonrpc/node' ;
111
109
112
- let lspProcess = child_process .spawn (' node' , [
113
- ' cypher-language-server.js' ,
114
- ' --stdio' ,
115
- ]);
110
+ let lspProcess = child_process .spawn (' cypher-language-server' , [' --stdio' ]);
116
111
let messageId = 1 ;
117
112
118
113
const reader = new rpc .StreamMessageReader (lspProcess .stdout );
0 commit comments