MartinBalin commented on code in PR #24:
URL: https://github.com/apache/netbeans-vscode/pull/24#discussion_r4186736102
##########
vscode/src/nbcode.ts:
##########
@@ -97,30 +98,67 @@ if (typeof process === 'object' && typeof process.argv0
==='string' && process.a
let args = process.argv.slice(2);
let json = JSON.parse("" + fs.readFileSync(path.join(extension,
'package.json')));
let storage;
-
- if (!env.nbcode_userdir || env.nbcode_userdir == 'global') {
- storage = path.join(os.platform() === 'darwin' ?
- path.join(os.homedir(), 'Library', 'Application Support') :
- path.join(os.homedir(), '.config'),
- 'Code', 'User', 'globalStorage', json.publisher + '.' +
json.name);
+ let datadir;
+ if (!env.nbcode_userdir) {
+ datadir= path.join(process.cwd(), "out", "userdir");
+ storage = path.join(datadir, json.publisher + '.' + json.name);
+ } else if (env.nbcode_userdir == 'global') {
+ if (os.platform() === 'darwin') {
+ datadir = path.join(os.homedir(), 'Library', 'Application
Support');
+ } else {
+ datadir = path.join(os.homedir(), '.config', 'Code', 'User',
'globalStorage');
+ }
+ storage = path.join(datadir, json.publisher + '.' + json.name);
} else {
+ datadir= path.join(process.cwd(), "out", "userdir");
storage = env.nbcode_userdir;
}
- console.log('Launching NBLS with user directory: ' + storage)
- let info = {
- clusters : clusters,
- extensionPath: extension,
- storagePath : storage,
- jdkHome : null
- };
- let p = launch(info, ...args);
- p.stdout.on('data', function(data) {
+ let extdir = path.join(process.cwd(), "out", "extdir")
+ let codeArgs = [
+ "--extensionDevelopmentPath=" + process.cwd(),
+ "--user-data-dir=" + datadir,
+ "--extensions-dir=" + extdir
+ ];
+ let extraEnv: NodeJS.ProcessEnv = env.netbeans_debug ? {
+ // no override of netbeans_debug
+ } : {
+ netbeans_debug :
'-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000'
+ }
+ extraEnv.netbeans_args = args.join(' ');
+ console.log('Launching `code` with following arguments:');
+ for (var arg of codeArgs) {
+ console.log(` ${arg}`);
+ }
+ {
+ let first = true;
+ for (var name in extraEnv) {
+ if (first) {
+ console.log('and following additional environment variables:');
+ first = false;
+ }
+ console.log(` ${name}=${extraEnv[name]}`);
+ }
+ }
+
+ let codeProc: ChildProcessByStdio<any, Readable, Readable> = spawn("code",
codeArgs, {
Review Comment:
**Module installation scripts lose their synchronous execution.**
`npm run apisupport` and `nbjavac` also call this entry point. They now
launch `code`, and completion reflects the VS Code CLI exiting rather than
installation finishing. Consequently, `apisupport`’s chained install/enable
operations are no longer ordered reliably. These commands also newly require
`code` on PATH; `ant test-vscode-ext` invokes `apisupport`. Preserve direct
NetBeans execution for maintenance commands.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists