@@ -6,7 +6,7 @@ import * as net from "net";
66import * as process from "process" ;
77import * as Annotator from "./annotator" ;
88
9- import { LanguageClient , LanguageClientOptions , ServerOptions , StreamInfo } from "vscode-languageclient/node" ;
9+ import { integer , LanguageClient , LanguageClientOptions , ServerOptions , StreamInfo } from "vscode-languageclient/node" ;
1010import { LuaLanguageConfiguration } from './languageConfiguration' ;
1111import { EmmyNewDebuggerProvider } from './debugger/new_debugger/EmmyNewDebuggerProvider' ;
1212import { EmmyAttachDebuggerProvider } from './debugger/attach/EmmyAttachDebuggerProvider' ;
@@ -114,10 +114,15 @@ async function doStartServer() {
114114 } ;
115115
116116 let serverOptions : ServerOptions ;
117- if ( ctx . debugMode && false ) { // TODO: Do NOT commit
117+ const config = vscode . workspace . getConfiguration (
118+ undefined ,
119+ vscode . workspace . workspaceFolders ?. [ 0 ]
120+ ) ;
121+ const debugPort = config . get < integer | null > ( "emmylua.ls.debugPort" ) ;
122+ if ( debugPort ) {
118123 // The server is a started as a separate app and listens on port 5007
119124 const connectionInfo = {
120- port : 5007
125+ port : debugPort
121126 } ;
122127 serverOptions = ( ) => {
123128 // Connect to language server via socket
@@ -132,10 +137,6 @@ async function doStartServer() {
132137 return Promise . resolve ( result ) ;
133138 } ;
134139 } else {
135- const config = vscode . workspace . getConfiguration (
136- undefined ,
137- vscode . workspace . workspaceFolders ?. [ 0 ]
138- ) ;
139140 let configExecutablePath = get < string > ( config , "emmylua.ls.executablePath" ) ?. trim ( ) ;
140141 if ( ! configExecutablePath || configExecutablePath . length == 0 ) {
141142 let platform = os . platform ( ) ;
0 commit comments