Skip to content

sourcegraph-demo-datree/lang-python

 
 

Repository files navigation

Code intelligence for Python (beta)

This extension provides Python code intelligence on Sourcegraph. Ensure this extension is enabled and then try it on some examples:

Screenshot

Usage with private Sourcegraph instances

This extension is configured to talk to a language server over WebSockets. If you are running a private Sourcegraph instance, you should run your own language server. The server is available as a Docker image sourcegraph/lang-python from Docker Hub.

Using Docker

  1. Run the Python language server Docker container:

    docker run --rm -p 4288:4288 sourcegraph/lang-python:insiders
  2. Enable this extension on your Sourcegraph https://sourcegraph.example.com/extensions/sourcegraph/lang-python

  3. Add these to your Sourcegraph settings:

      "python.serverUrl": "ws://localhost:4288",
      "python.sourcegraphUrl": "http://host.docker.internal:7080",

    If you're running on Linux, change python.sourcegraphUrl to the IP given by:

    ip addr show docker0 | grep -Po 'inet \K[\d.]+'

Authentication proxies and firewalls

Some customers deploy Sourcegraph behind an authentication proxy or firewall. If you do this, we recommend deploying the language server behind the proxy so that it can issue requests directly to Sourcegraph without going through the proxy. (Otherwise, you will need to configure the language server to authenticate through your proxy.) Make sure you set python.sourcegraphUrl to the URL that the language server should use to reach Sourcegraph, which is likely different from the URL that end users use.

Known issues

  • Dependencies are not installed. Hovers, definitions, and references only work for sources checked into the single repository you are viewing.
  • Cross-repository definitions and references are not yet supported.
  • Hangs on very large repositories (e.g. django/django)

About

Python language support for Sourcegraph based on the Microsoft Python language server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%