Skip to content

Commit 36ebf9f

Browse files
committed
Update config files
1 parent 864b4f5 commit 36ebf9f

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

client/build.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

client/ls-client/src/extension.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { execSync, exec, spawnSync } from 'child_process';
1+
import { execSync, spawnSync } from 'child_process';
22
import { ChildProcess, spawn } from 'mz/child_process';
33
import * as vscode from 'vscode';
44
import * as path from 'path';
@@ -8,17 +8,20 @@ import { LanguageClient, LanguageClientOptions, ServerOptions, StreamInfo } from
88
export function activate(context: vscode.ExtensionContext) {
99
var logChannel = vscode.window.createOutputChannel("Bal_LSP_and_Impl");
1010
const main: string = 'com.lspandimpl.launcher.stdio.StdioLauncher';
11-
const tcpMain: string = 'TCPLauncher'
11+
const tcpMain: string = 'com.lspandimpl.launcher.tcp.TCPLauncher'
1212
logChannel.appendLine("Starting the Ballerina Language Server Extension!");
1313

1414
getJavaHome().then(val => {
1515
let javaHome = ((val + '').split('java.home =')[1]).trim();
16-
logChannel.appendLine(javaHome);
17-
let excecutable: string = path.join(javaHome, 'bin', 'java');
16+
logChannel.appendLine('Java Home: [' + javaHome + ']');
1817

18+
let excecutable: string = path.join(javaHome, 'bin', 'java');
1919
let classPath = path.join(__dirname, '..', '*');
2020
const args: string[] = ['-cp', classPath];
21+
2122
let ballerinaHome = getBallerinaHome();
23+
logChannel.appendLine('Ballerina Home: [' + ballerinaHome + ']');
24+
2225
args.push('-Dballerina.home=' + ballerinaHome);
2326
if (process.env.LSDEBUG === "true") {
2427
logChannel.appendLine('LSDEBUG is set to "true". Language Server is starting on debug mode');
@@ -67,7 +70,6 @@ export function activate(context: vscode.ExtensionContext) {
6770
return childProcess
6871
});
6972
});
70-
7173
// ######## End of TCP Connection ########
7274

7375
let clientOptions: LanguageClientOptions = {
@@ -108,22 +110,12 @@ function getJavaHome() {
108110
}
109111

110112
function getBallerinaHome() {
111-
let cmd: string;
112-
113-
if (process.platform == 'win32') {
114-
cmd = 'java -XshowSettings:properties -version 2>&1 | findstr "java.home"';
115-
} else {
116-
cmd = "bal home";
117-
}
118-
119113
try {
120114
let response = spawnSync('bal', ['home']);
121115
if (response.stdout.length > 0) {
122116
return response.stdout.toString().trim();
123117
}
124118
} catch (er) {
125-
if (er instanceof Error) {
126-
return "Failed"
127-
}
119+
return "Failed to execute the command `bal home`";
128120
}
129121
}

client/package-lock.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

server/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
group 'org.example'
2-
version '1.0-SNAPSHOT'
1+
version project.version
32

43
apply plugin: 'java'
54

0 commit comments

Comments
 (0)