Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions java/java.lsp.server/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,18 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
}, time);
};

const ownName = "asf.apache-netbeans-java";
const ownExtension = vscode.extensions.getExtension(ownName);
if (!ownExtension) {
throw `Cannot find ${ownName} extension!`;
}
const version = ownExtension.packageJSON.version;
const beVerbose : boolean = workspace.getConfiguration('netbeans').get('verbose', false);
let info = {
clusters : findClusters(context.extensionPath),
extensionPath: context.extensionPath,
storagePath : context.globalStoragePath,
version: version,
jdkHome : specifiedJDK,
verbose: beVerbose
};
Expand Down
4 changes: 3 additions & 1 deletion java/java.lsp.server/vscode/src/nbcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface LaunchInfo {
clusters: string[];
extensionPath: string;
storagePath: string;
version: string;
jdkHome: string | unknown;
verbose? : boolean;
}
Expand All @@ -51,7 +52,7 @@ export function launch(
): ChildProcessByStdio<null, Readable, Readable> {
let nbcodePath = find(info);

const userDir = path.join(info.storagePath, "userdir");
const userDir = path.join(info.storagePath, "userdir-" + info.version);
fs.mkdirSync(userDir, {recursive: true});
let userDirPerm = fs.statSync(userDir);
if (!userDirPerm.isDirectory()) {
Expand Down Expand Up @@ -93,6 +94,7 @@ if (typeof process === 'object' && process.argv0 === 'node') {
let info = {
clusters : clusters,
extensionPath: extension,
version: json.version,
storagePath : globalStorage,
jdkHome : null
};
Expand Down