microsoft / vscode-lsif-extension

Extension for a LSIF Server
MIT License
73 stars 23 forks source link

Loading a very large LSIF file causes an internal error #6

Open mpickering opened 5 years ago

mpickering commented 5 years ago

I tried to load a 678mb LSIF file into the language server but it causes an internal error.

[Error - 9:36:21 AM] "toString()" failed
Error: "toString()" failed
    at stringSlice (buffer.js:560:43)
    at Buffer.toString (buffer.js:633:10)
    at Object.fs.readFileSync (fs.js:601:41)
    at Object.fs.readFileSync (ELECTRON_ASAR.js:538:29)
    at LsifDatabase.load (/home/matt/.vscode/extensions/ms-vscode.lsif-0.1.0/server/out/lsifDatabase.js:41:34)
    at /home/matt/.vscode/extensions/ms-vscode.lsif-0.1.0/server/out/lsifServer.js:97:26
    at Generator.next (<anonymous>)
    at fulfilled (/home/matt/.vscode/extensions/ms-vscode.lsif-0.1.0/server/out/lsifServer.js:8:58)
    at <anonymous>

The file is for a single (very big) project with over 3000 modules, 400 000 lines of code. It seems the failure is at the point where it tries to read the file.

dbaeumer commented 5 years ago

@mpickering I am aware of this and I am working on a version of the extension that reads the dump from a real database (SQLite) instead of reading it into memory. This should bring big memeory footprint savings.