jtulach commented on code in PR #24:
URL: https://github.com/apache/netbeans-vscode/pull/24#discussion_r4194433077


##########
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') {

Review Comment:
   - I don't think this is very useful review comment
      - getting this location right was important previously ...
      - ...when the `nbcode.ts` launched a headless NetBeans first, and then
      - ...`code` was trying to connect to it
      - at that moment they **needed the same userdir**
   - but this is not true anymore
      - now we set everything up and let `code` run
      - it launches its own `nbcode` with open JDWP port, with some userdir
      - the debugger just connects to it
   - e.g. the location of `nbcode_userdir` doesn't really matter anymore
   - anyway I did few changes: 74b3144
   - and now with
   ```
   netbeans-vscode/vscode$ JAVA_HOME=/jdk-21/ nbcode_userdir=global npm run 
nbcode
   ```
   - `nbcode` then uses 
`netbeans-vscode/vscode/out/datadir/User/globalStorage/asf.apache-netbeans-java/userdir`
 as their `--userdir`
   - when we launch just
   ```
   netbeans-vscode/vscode$ JAVA_HOME=/jdk-21/ npm run nbcode
   ```
   - then the `--userdir` is `  
netbeans-vscode/vscode/out/datadir/User/workspaceStorage/4aae1abaf42cf9f03b9a1ab877cd0f2d/asf.apache-netbeans-java/userdir/`
   - e.g. in both caches it is _"local temporary dir"_ inside of 
`netbeans-vscode/vscode/out` directory



-- 
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

Reply via email to