ayecue / greybel-vs

VSCode extension for GreyScript.
https://marketplace.visualstudio.com/items?itemName=ayecue.greybel-vs
MIT License
16 stars 7 forks source link

Trying to open files not there #243

Closed linuxgruven closed 2 months ago

linuxgruven commented 2 months ago

I keep getting the following errors Error: ENOENT: no such file or directory, open '/home/brian/Documents/GitHub/x/home/tux/src/0.src' at async open (node:internal/fs/promises:638:25) at async Object.readFile (node:internal/fs/promises:1266:14) at async K_.fetchTextDocument (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/nodemodules/greybel-languageserver/index.js:326:38355) at async K.getTextDocument (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/nodemodules/greybel-languageserver/index.js:326:38643) at async F.open (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/node_modules/greybel-languageserver/index.js:326:26979) at async r (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/node_modules/greybel-languageserver/index.js:326:25237) at async zo.getImports (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/node_modules/greybel-languageserver/index.js:326:25341) at async gb (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/node_modules/greybel-languageserver/index.js:110:361661) at async mb.buildTypeMap (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/node_modules/greybel-languageserver/index.js:110:363918) at async mb.lookupTypeInfo (/home/brian/.vscode/extensions/ayecue.greybel-vs-2.4.11/node_modules/greybel-languageserver/index.js:110:364003) { errno: -2, code: 'ENOENT', syscall: 'open', path: '/home/brian/Documents/GitHub/x/home/tux/src/0.src' } for files/folders no longer there

linuxgruven commented 2 months ago

about every 3-5 minutes I get this error

linuxgruven commented 2 months ago

I just did this for now error2

ayecue commented 2 months ago

Interesting. I tried replicating it by deleting a file that got imported into another file. But it seems to work fine for me. Anyway looking at the language server code I can see that there is the possibility of it crashing if files don't exist. I've added a fix and updated the extension to use the latest version. The issue should not occur in the future anymore.

The log Error: ENOENT: no such file or directory may still occur in the future though. But it should be only visible in the developer console.

I just did this for now error2

This won't have any influence on those error popups you showed. This silencing of error popups is only for the error thrown by the interpreter if there are mistakes in the code or that sort.

Anyway I hope this will fix the issue for you as well. In case it reoccurs post 2.4.12 feel free to reopen the ticket. Also thanks for reporting.

ayecue commented 2 months ago

@linuxgruven FYI I made another fix which should fix the actual issue you had yesterday. It was caused when there was invalid syntax at some point.