Git Product home page Git Product logo

sourcegraph-basic-code-intel's Introduction

Basic code intelligence for Sourcegraph

Build Status codecov

basic-code-intel provides fuzzy code intelligence using a combination of ctags and search. All of the programming language Sourcegraph extensions use the basic-code-intel npm package that lives in this repository.

Development

First install goreman:

$ go get github.com/mattn/goreman

Then run:

$ ./dev

Open up your Sourcegraph settings https://sourcegraph.com/users/you/settings and disable the language extensions you're developing:

  "extensions": {
      "sourcegraph/cpp": false,
      ...
  }

Then sideload the extension (http://localhost:1234) on your Sourcegraph instance and refresh the page. Make sure you don't see two of the same language extension.

Open the browser Network tab and you should start seeing graphql?Search calls when you hover over tokens.

Anatomy of this repository

Updating the basic-code-intel package

After you make a change to the basic-code-intel package and bump the version number in package/package.json, build and publish it to npm:

cd package
yarn run build
npm publish

Then, update the version in the downstream language extensions by bumping the version in package.json.

Finally, publish the extensions with bash generator/generate.sh --publish.

Creating your own language extension based on @sourcegraph/basic-code-intel

  1. Create a new extension https://docs.sourcegraph.com/extensions/authoring/creating
  2. Take a look at the Go extension to see how to use the @sourcegraph/basic-code-intel package
  3. Change the file extensions, test, and publish

Adding a new sourcegraph/sourcegraph-LANG extension

  1. Add an entry to languages in generator/src/main.ts
  2. (optional, to enable jump to definition) Ensure the language is present in the command line arguments to universal-ctags https://github.com/sourcegraph/sourcegraph/blob/21efc6844838e773b9a8f4a7ba1d5628e8076984/cmd/symbols/internal/pkg/ctags/parser.go#L71
  3. Run bash generate.sh --languages <language name> --publish

sourcegraph-basic-code-intel's People

Contributors

chrismwendt avatar renovate[bot] avatar beyang avatar sqs avatar felixfbecker avatar ryan-blunden avatar dadlerj avatar efritz avatar lguychard avatar kattmingming avatar renovate-bot avatar rvantonder avatar uk-ar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.