@@ -2,13 +2,13 @@ import * as path from "path";
2
2
import { workspace , ExtensionContext , commands } from "vscode" ;
3
3
4
4
import {
5
- LanguageClient ,
6
- LanguageClientOptions ,
7
- ServerOptions ,
8
- TransportKind ,
5
+ LanguageClient ,
6
+ LanguageClientOptions ,
7
+ ServerOptions ,
8
+ TransportKind ,
9
9
} from "vscode-languageclient/node" ;
10
10
11
- import * as customCommands from ' ./commands' ;
11
+ import * as customCommands from " ./commands" ;
12
12
13
13
let client : LanguageClient ;
14
14
@@ -61,55 +61,55 @@ let client: LanguageClient;
61
61
// });
62
62
63
63
export function activate ( context : ExtensionContext ) {
64
- // The server is implemented in node
65
- let serverModule = context . asAbsolutePath (
66
- path . join ( "server" , "out" , "server.js" )
67
- ) ;
68
- // The debug options for the server
69
- // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
70
- let debugOptions = { execArgv : [ "--nolazy" , "--inspect=6009" ] } ;
64
+ // The server is implemented in node
65
+ let serverModule = context . asAbsolutePath (
66
+ path . join ( "server" , "out" , "server.js" )
67
+ ) ;
68
+ // The debug options for the server
69
+ // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
70
+ let debugOptions = { execArgv : [ "--nolazy" , "--inspect=6009" ] } ;
71
71
72
- // If the extension is launched in debug mode then the debug server options are used
73
- // Otherwise the run options are used
74
- let serverOptions : ServerOptions = {
75
- run : { module : serverModule , transport : TransportKind . ipc } ,
76
- debug : {
77
- module : serverModule ,
78
- transport : TransportKind . ipc ,
79
- options : debugOptions ,
80
- } ,
81
- } ;
72
+ // If the extension is launched in debug mode then the debug server options are used
73
+ // Otherwise the run options are used
74
+ let serverOptions : ServerOptions = {
75
+ run : { module : serverModule , transport : TransportKind . ipc } ,
76
+ debug : {
77
+ module : serverModule ,
78
+ transport : TransportKind . ipc ,
79
+ options : debugOptions ,
80
+ } ,
81
+ } ;
82
82
83
- // Options to control the language client
84
- let clientOptions : LanguageClientOptions = {
85
- // Register the server for plain text documents
86
- documentSelector : [ { scheme : "file" , language : "rescript" } ] ,
87
- synchronize : {
88
- // Notify the server about file changes to '.clientrc files contained in the workspace
89
- fileEvents : workspace . createFileSystemWatcher ( "**/.clientrc" ) ,
90
- } ,
91
- } ;
83
+ // Options to control the language client
84
+ let clientOptions : LanguageClientOptions = {
85
+ // Register the server for plain text documents
86
+ documentSelector : [ { scheme : "file" , language : "rescript" } ] ,
87
+ synchronize : {
88
+ // Notify the server about file changes to '.clientrc files contained in the workspace
89
+ fileEvents : workspace . createFileSystemWatcher ( "**/.clientrc" ) ,
90
+ } ,
91
+ } ;
92
92
93
- // Create the language client and start the client.
94
- client = new LanguageClient (
95
- "ReScriptLSP" ,
96
- "ReScript Language Server" ,
97
- serverOptions ,
98
- clientOptions
99
- ) ;
93
+ // Create the language client and start the client.
94
+ client = new LanguageClient (
95
+ "ReScriptLSP" ,
96
+ "ReScript Language Server" ,
97
+ serverOptions ,
98
+ clientOptions
99
+ ) ;
100
100
101
- // Register custom commands
102
- commands . registerCommand ( ' rescript-vscode.create_interface' , ( ) => {
103
- customCommands . createInterface ( client ) ;
104
- } ) ;
101
+ // Register custom commands
102
+ commands . registerCommand ( " rescript-vscode.create_interface" , ( ) => {
103
+ customCommands . createInterface ( client ) ;
104
+ } ) ;
105
105
106
- // Start the client. This will also launch the server
107
- client . start ( ) ;
106
+ // Start the client. This will also launch the server
107
+ client . start ( ) ;
108
108
}
109
109
110
110
export function deactivate ( ) : Thenable < void > | undefined {
111
- if ( ! client ) {
112
- return undefined ;
113
- }
114
- return client . stop ( ) ;
111
+ if ( ! client ) {
112
+ return undefined ;
113
+ }
114
+ return client . stop ( ) ;
115
115
}
0 commit comments