saem / vscode-nim

Other
177 stars 23 forks source link

Cannot read property 'length' #51

Closed citrusn closed 3 years ago

citrusn commented 3 years ago

[2021-09-11 21:33:07.754] [renderer7] [error] Cannot read property 'length' of undefined: TypeError: Cannot read property 'length' of undefined at HEX3Aanonymous_419430796 (c:\Users\Дима.vscode\extensions\nimsaem.nimvscode-0.1.25\out\nimvscode.js:10932:76) at processTicksAndRejections (internal/process/task_queues.js:93:5)

citrusn commented 3 years ago

Outline window is empty: No symbol found...

saem commented 3 years ago

From the command palette, typically Ctrl+shift+p, if you type "clear" or "Nim", can't recall exactly, it should list a series of commands you can invoke.

One of them is too the effect of, clear Nim caches, or something. The extension maintains an index of information retrieved about the Nim project (auto-detected one per file or specified in config, latter refined) using nimsuggest. This stuff is stored in the dedicated VSCode extension/workspace storage. It's two new line separated json files, one for the files the other for types etc. Anyhow, IIRC that's what's used to generate the outline.

By running the clear, watch in the bottom right as immediately after an indexing task will kickoff, speed depends on project size, project being determined by the main Nim file you have configured.

Anyway, after indexing is done see if it works, if so then you're all set, if not then likely nimsuggest is having a bad time with your project and/or you haven't told the extension about your project and each file in your project isn't independent.

citrusn commented 3 years ago

I had the following error in my nimsuggest.log file: Error: cannot open 'c:\Users\\xD0\x94\xD0\xB8\xD0\xBC\xD0\xB0\AppData\Roaming\Code\User\workspaceStorage\d5bc8f1a26c1a7c1cda3b953df120bb9\nimsaem.nimvscode\vscodenimdirty_24904\-203733408.nim' After changing the my home folder name without utf-8 characters, the outline window worked. Thanks you!