nim-lang / vscode-nim

A VS Code plugin for the Nim language
Other
78 stars 8 forks source link

VSCode Portable fails on Windows #101

Closed jmgomez closed 2 months ago

jmgomez commented 2 months ago
          > Did you test it with the custom build of the extension that I sent over?

in vscode 64bit 1.92.2 in portable mode i've disabled all extensions and then installed your custom build nimvscode-1.0.3.vsix of the nim-lang.org-extension . nim -v = 2.1.99 [Windows: amd64] Compiled at 2024-09-11 . the newest nimlangserver 64bit 1.5.1 . when i drag-&-drop a nim file into vscode , there is now the empty "output"-log-window named "Nim Lsp" , but the log-window ''Extension Host''("trace"-mode) shows :

2024-09-11 08:32:28.998 [info] ExtensionService#_doActivateExtension NimLang.nimlang, startup: false, activationEvent: 'onLanguage:nim'
2024-09-11 08:32:28.999 [trace] ExtensionService#loadCommonJSModule file:///d:/portable_programs/_ from C/vscode/64bit/data/extensions/nimlang.nimlang-1.0.3/out/nimvscode.js
2024-09-11 08:32:28.999 [trace] ExtensionService#loadExtensionContext NimLang.nimlang
2024-09-11 08:32:29.640 [trace] ExtensionService#_callActivateOptional NimLang.nimlang
2024-09-11 08:32:29.641 [trace] ExtHostCommands#registerCommand nim.run.file
2024-09-11 08:32:29.642 [trace] ExtHostCommands#registerCommand nim.debug.file
2024-09-11 08:32:29.642 [trace] ExtHostCommands#registerCommand nim.check
2024-09-11 08:32:29.642 [trace] ExtHostCommands#registerCommand nim.restartNimsuggest
2024-09-11 08:32:29.643 [trace] ExtHostCommands#registerCommand nim.execSelectionInTerminal
2024-09-11 08:32:29.643 [trace] ExtHostCommands#registerCommand nim.clearCaches
2024-09-11 08:32:29.643 [trace] ExtHostCommands#registerCommand nim.listCandidateProjects
2024-09-11 08:32:29.643 [trace] ExtHostCommands#registerCommand nim.showNimLangServerStatus
2024-09-11 08:32:29.643 [trace] ExtHostCommands#registerCommand nim.showNotification
2024-09-11 08:32:29.644 [trace] ExtHostCommands#registerCommand nim.onDeleteNotification
2024-09-11 08:32:29.644 [trace] ExtHostCommands#registerCommand nim.onClearAllNotifications
2024-09-11 08:32:29.649 [error] Activating extension NimLang.nimlang failed due to an error:
2024-09-11 08:32:29.649 [error] TypeError: Cannot read properties of undefined (reading 'uri')
    at setNimDir_553649167 (d:\portable_programs\_ from C\vscode\64bit\data\extensions\nimlang.nimlang-1.0.3\out\nimvscode.js:14987:76)
    at activate_553649247 (d:\portable_programs\_ from C\vscode\64bit\data\extensions\nimlang.nimlang-1.0.3\out\nimvscode.js:19860:5)
    at z.kb (d:\portable_programs\_ from C\vscode\64bit\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:13608)
    at z.jb (d:\portable_programs\_ from C\vscode\64bit\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:13280)
    at d:\portable_programs\_ from C\vscode\64bit\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:11267
    at async m.n (d:\portable_programs\_ from C\vscode\64bit\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:6409)
    at async m (d:\portable_programs\_ from C\vscode\64bit\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:6372)
    at async m.l (d:\portable_programs\_ from C\vscode\64bit\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:5829)
2024-09-11 08:32:29.650 [trace] [vscode.merge-conflict] INVOKE provider 'x=>x.provideCodeLenses(u.URI.revive(G),J)'
2024-09-11 08:32:29.653 [trace] ExtHostCommands#executeCommand setContext
2024-09-11 08:32:29.653 [trace] ExtHostCommands#executeCommand _setContext
2024-09-11 08:32:29.653 [trace] [vscode.merge-conflict] provider DONE after 3ms

independent of the above , a difference of vscode standard vs vscode in portable mode : in vscode in portable mode , the env-var VSCODE_PORTABLE is available and holds the absolute dir path to the "data\"-dir . for example "extensions\"-dir and "user-data\"-dir are reachable via "{VSCODE_PORTABLE}\extensions\" "{VSCODE_PORTABLE}\user-data\"

Originally posted by @dreamflow in https://github.com/nim-lang/vscode-nim/issues/93#issuecomment-2342845607

jmgomez commented 2 months ago

Tested on Win11 with the store version of the extension, vscode portable and dev nimlangserver and works fine:

image

Will retest on Win10 when I have the chance

jmgomez commented 2 months ago

Tested on Win10 and it seems to be fine as well.

Cant repro your issue @dreamflow, can you elaborate a bit more in your project structure and config if any?

dreamflow commented 2 months ago

Tested on Win10 and it seems to be fine as well.

i can confirm that .

what i've done now , is that i've made a new clean fresh portable installation of vscode 1.93.1 from the ground up and only installed the 1 extension : nim-lang.org(nimvscode-1.0.3.vsix) and nimlangserver.exe 64bit 1.5.1 .

and now the nim-lang.org-extension starts normal 🙂

many thanks for your very patient support !

this case can be closed as successfully solved .