3 ms·
Is it easy to add new languages? I work at a large company with some very old codebases.
by neves 8y ago
Is it easy to add new languages? I work at a large company with some very old codebases.
- beliu 8y ago@chrismwendt is a Sourcegrapher working on this. Posting this on his behalf: Here is how I added GraphQL support last week: - Follow the hello world tutorial https://github.com/sourcegraph/sourcegraph-extension-docs/blob/master/tutorials/hello-world.md https://github.com/sourcegraph/sourcegraph-extension-docs/bl... - Add logic to handle hovers and definitions https://github.com/sourcegraph/sourcegraph-graphql https://github.com/sourcegraph/sourcegraph-graphql - Write the server part https://github.com/chrismwendt/graphql-ws-langserver https://github.com/chrismwendt/graphql-ws-langserver (once a browser-based GraphQL analysis library exists, this would be unnecessary because the analysis could be done entirely in the browser) It's available at https://sourcegraph.com/extensions/chris/graphql https://sourcegraph.com/extensions/chris/graphql and once you enable it you can test it out on a GraphQL file such as https://sourcegraph.com/github.com/chrismwendt/graphql-ws-langserver@master/-/blob/schema.gql?diff=5a6f2dc350ec67e8aa8c8b606fd3a8fb0c66d578 https://sourcegraph.com/github.com/chrismwendt/graphql-ws-la... (it's pretty slow/janky at the moment and could be improved, but works). If you're interested in interfacing with other tools too, you might be interested in LSP (Language Server Protocol): - https://langserver.org/ https://langserver.org/ - https://microsoft.github.io/language-server-protocol/specification https://microsoft.github.io/language-server-protocol/specifi...