adrienjoly / algocodesearch

šŸ•µļøā€ā™€ļø off-sprint project that intends to index symbols from a language server (LSP), for code search
5 stars 1 forks source link
code-search language-server lsp

algocodesearch

Off-sprint project that intends to index symbols from a language server (LSP), for code search.

Try the resulting Code Seach UI: https://codesandbox.io/s/ais-ecommerce-demo-app-580me.

Vision

Do better than GitHub to discover and explore a codebase.

Use cases:

How to use the back-end

JavaScript/TypeScript

$ git clone https://github.com/sourcegraph/javascript-typescript-langserver.git
$ cd javascript-typescript-langserver
$ npm install
$ npm run build
$ node lib/language-server --trace

Go

# Install https://github.com/golang/tools/tree/master/gopls
$ gopls -v serve -rpc.trace --port 2089 --debug=localhost:6060 -logfile /tmp/log.log -listen 127.0.0.1:2089
$ git clone https://github.com/adrienjoly/algocodesearch.git
$ cd algocodesearch
$ npm install
$ npm run test:js # with js lsp running
$ npm run test:go # with go lsp running

This should send a LSP request to the server and print the response to stdout.

# git clone https://github.com/adrienjoly/algocodesearch.git
# cd algocodesearch
# npm install
$ node indexing.js ../my-js-project/ "output-file-prefix"
# => will generate output-file-prefix-index-symbols.json and output-file-prefix-index-refs.json

WIP / Next Steps