Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
GH-42: Distinguished between the executables based on the OS.
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
  • Loading branch information
kittaakos committed Nov 2, 2017
1 parent 687b37f commit 91d1677
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions theia-yang-extension/src/backend/backend-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
*/

import { join, resolve } from 'path'
import { injectable, ContainerModule } from "inversify"
import { BaseLanguageServerContribution, IConnection, LanguageServerContribution } from "@theia/languages/lib/node"

import { injectable, ContainerModule } from 'inversify'
import { BaseLanguageServerContribution, IConnection, LanguageServerContribution } from '@theia/languages/lib/node'
import { isWindows } from '@theia/core/lib/common/os'
import { createSocketConnection } from 'vscode-ws-jsonrpc/lib/server'
import * as net from 'net'

const EXECUTABLE_PATH = resolve(join(__dirname, '..', '..', 'build', 'yang-language-server', 'bin', 'yang-language-server'))
const EXECUTABLE_NAME = isWindows ? 'yang-language-server.bat' : 'yang-language-server'
const EXECUTABLE_PATH = resolve(join(__dirname, '..', '..', 'build', 'yang-language-server', 'bin', EXECUTABLE_NAME))

function getPort(): number | undefined {
let arg = process.argv.filter(arg => arg.startsWith("--YANG_LSP="))[0]
let arg = process.argv.filter(arg => arg.startsWith('--YANG_LSP='))[0]
if (!arg) {
return undefined
} else {
return Number.parseInt(arg.substring("--YANG_LSP=".length))
return Number.parseInt(arg.substring('--YANG_LSP='.length))
}
}

Expand Down

0 comments on commit 91d1677

Please sign in to comment.