microsoft / vscode-lsif-extension Goto Github PK
View Code? Open in Web Editor NEWExtension for a LSIF Server
License: MIT License
Extension for a LSIF Server
License: MIT License
{"id":0,"type":"vertex","label":"metaData","version":"0.3.1","projectRoot":"file:///d:/LSIF_test"}
{"id":1,"type":"vertex","label":"project","kind":"cpp"}
{"id":2,"type":"vertex","label":"document","uri":"file:///d:/LSIF_test/file.txt","languageId":"cpp"}
{"id":3,"type":"edge","label":"contains","outV":1,"inV":2}
(Note projectRoot is file:///d:/LSIF_test
and document is a direct child: file:///d:/LSIF_test/file.txt
)
Expected: file.txt
is listed in Explorer.
Actual: Expander in Explorer is spinning for minutes before crashing.
file:///d:/LSIF_test/x/file.txt
(note /x/
added).file.txt
(under x
node).Even after the fix for #24 I still can't open the sample database:
[Error - 14:36:06] Can't create database for lsif:/c%3A/Users/...
After I modified
vscode-lsif-extension/server/src/lsifServer.ts
Lines 135 to 137 in 42be1c8
by adding this line to the catch block:
connection.console.error(_error.message);
I got this:
[Error - 14:36:06] The module '\\?\c:\Users\XXX\Documents\GitHub\XXX\vscode-lsif-extension\server\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 85. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
I am building and testing with this:
Version: 1.55.0-insider (user setup)
Commit: c185983a683d14c396952dd432459097bc7f757f
Date: 2021-03-30T12:48:52.547Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042
getting error while opening dump.lsif file.
Steps:-
1- I created the 'dump.lsif' file for one of the typescript file .
2- After launching the client from the server 'vscode-lsif-extension', opened the LSIF database file(dump.lsif) from the extension host and got the error attached in the screenshot.
Please refer to the attached screenshot for more details
Hi, I've got this error.
Any idea?
$ npm run compile
> [email protected] compile
> tsc -b
server/node_modules/lsif-protocol/lib/protocol.d.ts:897:65 - error TS2344: Type 'T' does not satisfy the constraint 'Object'.
897 export declare class EdgeDescriptor<T> extends ObjectDescriptor<T> {
~
server/node_modules/lsif-protocol/lib/protocol.d.ts:897:37
897 export declare class EdgeDescriptor<T> extends ObjectDescriptor<T> {
~
This type parameter might need an `extends Object` constraint.
server/node_modules/lsif-protocol/lib/protocol.d.ts:900:48 - error TS2344: Type 'T' does not satisfy the constraint 'Object'.
900 constructor(description: ObjectDescription<T>, cardinality: Cardinality, edgeDescriptions: [VertexDescriptor<V>, VertexDescriptor<V>][]);
~
server/node_modules/lsif-protocol/lib/protocol.d.ts:897:37
897 export declare class EdgeDescriptor<T> extends ObjectDescriptor<T> {
~
This type parameter might need an `extends Object` constraint.
Found 2 errors.
node
version is v20.5.0
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.
When I clone this repository, press F5 and try to open the sample database (Via > Open LSIF database) I receive the following output.
(node:2712) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
c:\Users\tdg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js:5
(node:11152) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
c:\Users\tdg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js:5
rejected promise not handled within 1 second: Error: ENOTDIR: not a directory, scandir 'c:\Anta\vscode-lsif-extension\samples\jsonrpc.lsif'
c:\Users\tdg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js:5
stack trace: Error: ENOTDIR: not a directory, scandir 'c:\Anta\vscode-lsif-extension\samples\jsonrpc.lsif'
c:\Users\tdg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js:5
VS Code About:
Version: 1.62.3 (user setup)
Commit: ccbaa2d27e38e5afa3e5c21c1c7bef4657064247
Date: 2021-11-17T08:11:14.551Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.22000
If I symlink a file to the workspace then the language server refuses to read it. It only works if I copy the lsif.json
file into the right place.
If you change the lsif.json
file, the language server should reload from the new information.
Would it be possible to make this a vscode independent language server, so that any editor supporting LSP could take advantage of it?
Probably because the samples were created with an older LSIF version. I can see that jsonrpc.lsif was created with LSIF version 0.3.1
No project root provided
message in Output when trying to load jsonrpc.lsifCan't create database for lsif:/c%3A/XXX/samples/jsonrpc.db
when trying to load jsonrpc.dbfile:///c
with file:///C
and open the file.Expected: Files are still listed under the lsif node.
Actual: There is nothing listed under the lsif node.
C++ template hover text will have characters <
and >
in the hover text.
e.g. vector<int> v
which rendered in VS Code as vector v
.
The hover text needs to be properly escaped or its content type set before it is returned.
npm install -g lsif
npm install
lsif tsc -p .\tsconfig.json samples/self.lsif
Open LSIF Database
, navigate to this repo's samples
folder and choose self.lsif
Debugger listening on ws://127.0.0.1:6029/d9ff94d1-7c1e-4018-97e1-d3d698768c54
For help, see: https://nodejs.org/en/docs/inspector
[Error - 14:54:21] Requires version 0.5.0 or higher but received: 0.5.3
Consider the following LSIF file:
{"id":0,"type":"vertex","label":"metaData","version":"0.3.1","projectRoot":"file:///d:/current/LSIF"}
{"id":1,"type":"vertex","label":"project","kind":"cpp"}
{"id":2,"type":"vertex","label":"document","uri":"file:///d:/current/LSIF/repro/test.cpp","languageId":"cpp","contents":"aQBuAHQAIABhADsACgBpAG4AdAAgAGIAIAA9ACAAYQA7AAoAIAAgAA"}
{"id":3,"type":"vertex","label":"resultSet"}
{"id":5,"type":"vertex","label":"range","start":{"line":0,"character":4},"end":{"line":0,"character":5}}
{"id":6,"type":"vertex","label":"definitionResult"}
{"id":8,"type":"vertex","label":"resultSet"}
{"id":10,"type":"vertex","label":"range","start":{"line":1,"character":4},"end":{"line":1,"character":5}}
{"id":11,"type":"vertex","label":"definitionResult"}
{"id":13,"type":"vertex","label":"range","start":{"line":1,"character":8},"end":{"line":1,"character":9}}
{"id":"e0","type":"edge","label":"contains","outV":1,"inV":2}
{"id":"e1","type":"edge","label":"contains","outV":2,"inV":5}
{"id":"e2","type":"edge","label":"contains","outV":2,"inV":10}
{"id":"e3","type":"edge","label":"contains","outV":2,"inV":13}
{"id":"e5","type":"edge","label":"textDocument/definition","outV":3,"inV":6}
{"id":"e7","type":"edge","label":"refersTo","outV":5,"inV":3}
{"id":"e8","type":"edge","label":"item","outV":6,"inV":5}
{"id":"e12","type":"edge","label":"textDocument/definition","outV":8,"inV":11}
{"id":"e14","type":"edge","label":"refersTo","outV":10,"inV":8}
{"id":"e15","type":"edge","label":"item","outV":11,"inV":10}
{"id":"e17","type":"edge","label":"refersTo","outV":13,"inV":3}
corresponding to the following program:
int a;
int b = a;
Note that definitionResult
vertices have result
keys omitted, with the relationships instead provided by the item
edges (id e8
and e15
) as discussed in microsoft/lsif-node#3.
Expected: Go to Definition resolves.
Actual: Go to Definition fails.
The LSIF server at https://github.com/microsoft/vscode-lsif-extension/tree/master/server is useful not just for VS Code, but also for other services providing code intelligence. If it were published as an npm package, anyone could use and contribute improvements to it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.