def start_server():
deleteDbIfExists()
working_dir = os.path.join(util.get_plugin_folder(), 'apex-jorje-lsp.jar')
java_cmd = 'java'
java_path = util.get_setting('java_path')
util.debug(java_path)
if java_path != '':
java_cmd = os.path.join(java_path, java_cmd)
util.debug('using java path: ', java_cmd)
args = [java_cmd, '-cp', working_dir, '-Ddebug.internal.errors=true','-Ddebug.semantic.errors=false',
'apex.jorje.lsp.ApexLanguageServerLauncher']
util.debug("starting " + str(args))
si = None
if os.name == "nt":
si = subprocess.STARTUPINFO() # type: ignore
si.dwFlags |= subprocess.SW_HIDE | subprocess.STARTF_USESHOWWINDOW # type: ignore
try:
process = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=util.dxProjectFolder(),
startupinfo=si)
return Client(process)
except Exception as err:
util.debug(err)
评论列表
文章目录