@@ -12,24 +12,25 @@ import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, T
1212export function activate ( context : ExtensionContext ) {
1313
1414 // The server is implemented in node
15- let serverExe = context . asAbsolutePath ( '../sample/SampleServer/bin/Debug/netcoreapp1.1/win7-x64/SampleServer.exe' ) ;
15+ let serverExe = 'D:/Development/Omnisharp/omnisharp-roslyn/bin/Debug/OmniSharp.Stdio/net46/OmniSharp.exe' ;
16+ // let serverExe = context.asAbsolutePath('D:/Development/Omnisharp/omnisharp-roslyn/artifacts/publish/OmniSharp.Stdio/win7-x64/OmniSharp.exe');
1617 // The debug options for the server
17- let debugOptions = { execArgv : [ "--nolazy" , "--debug=6009" ] } ;
18+ // let debugOptions = { execArgv: ['-lsp', '-d' };
1819
1920 // If the extension is launched in debug mode then the debug server options are used
2021 // Otherwise the run options are used
2122 let serverOptions : ServerOptions = {
22- run : { command : serverExe } ,
23- debug : { command : serverExe , options : debugOptions }
23+ run : { command : serverExe , args : [ '-lsp' ] } ,
24+ debug : { command : serverExe , args : [ '-lsp' , '-d' ] }
2425 }
2526
2627 // Options to control the language client
2728 let clientOptions : LanguageClientOptions = {
2829 // Register the server for plain text documents
29- documentSelector : [ {
30- language : 'xml' ,
31- pattern : '*.csproj'
32- } ] ,
30+ // documentSelector: [{
31+ // language: 'xml',
32+ // pattern: '*.csproj'
33+ // }],
3334 synchronize : {
3435 // Synchronize the setting section 'languageServerExample' to the server
3536 configurationSection : 'languageServerExample' ,
@@ -39,7 +40,8 @@ export function activate(context: ExtensionContext) {
3940 }
4041
4142 // Create the language client and start the client.
42- let disposable = new LanguageClient ( 'languageServerExample' , 'Language Server Example' , serverOptions , clientOptions ) . start ( ) ;
43+ const client = new LanguageClient ( 'languageServerExample' , 'Language Server Example' , serverOptions , clientOptions ) ;
44+ let disposable = client . start ( ) ;
4345
4446 // Push the disposable to the context's subscriptions so that the
4547 // client can be deactivated on extension deactivation
0 commit comments