GithubHelp home page GithubHelp logo

xpie-team / jetbrains Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sourcegraph/jetbrains

0.0 0.0 0.0 2.1 MB

License: Apache License 2.0

Shell 0.70% JavaScript 0.07% Java 40.20% Kotlin 58.46% TypeScript 0.35% Nix 0.18% HTML 0.05%

jetbrains's Introduction

Sourcegraph Cody + Code Search

Use Sourcegraph’s AI assistant Cody and Sourcegraph Code Search directly from your JetBrains IDE.

  • Cody is a free and open-source AI coding assistant that can write, understand and fix your code. Cody is powered by Sourcegraph’s code graph, and has knowledge of your entire codebase.
  • With Code Search, you can search code across all your repositories and code hosts—even the code you don’t have locally.

Cody for JetBrains IDEs is experimental right now. We’d love your feedback!

Cody Features

Autocomplete: Cody writes code for you

Cody autocompletes single lines, or whole functions, in any programming language, configuration file, or documentation. It’s powered by latest instant LLM models for accuracy and performance.

Example of using code autocomplete

Chat: Ask Cody about anything in your codebase

Cody understands your entire codebase — not just your open files. Ask Cody any question about your code, and it will use Sourcegraph's code graph to answer using knowledge of your codebase.

For example, you can ask Cody:

  • "How is our app's secret storage implemented on Linux?"
  • "Where is the CI config for the web integration tests?"
  • "Write a new GraphQL resolver for the AuditLog"
  • "Why is the UserConnectionResolver giving an "unknown user" error, and how do I fix it?"
  • "Add helpful debug log statements"
  • "Make this work" (seriously, it often works—try it!)

Example of chatting with Cody

Built-in commands

Cody has quick commands for common actions. Select the commands tab or right-click on a selection of code and choose one of the Ask Cody > ... commands, such as:

  • Explain code
  • Generate unit test
  • Generate docstring
  • Improve variable names
  • Smell code

We also welcome also pull request contributions for new, useful commands!

Swappable LLMs

On entreprise plans, Cody supports Anthropic Claude, Claude 2, and OpenAI GPT-4/3.5 models, with more coming soon.

Free usage

Cody is currently in beta, and includes free LLM usage for individual users on both personal and work code. Fair use limits apply.

Programming language support

Cody works for any programming language because it uses LLMs trained on broad data. Cody works great with Python, Go, JavaScript, and TypeScript code.

Code graph

Cody is powered by Sourcegraph’s code graph and uses context of your codebase to extend its capabilities. By using context from entire repositories, Cody is able to give more accurate answers and generate idiomatic code.

For example:

  • Ask Cody to generate an API call. Cody can gather context on your API schema to inform the code it writes.
  • Ask Cody to find where in your codebase a specific component is defined. Cody can retrieve and describe the exact files where that component is written.
  • Ask Cody questions that require an understanding of multiple files. For example, ask Cody how frontend data is populated in a React app; Cody can find the React component definitions to understand what data is being passed and where it originates.

Embeddings

Cody indexes your entire repository and generates embeddings, which are a vector representation of your entire codebase. Cody queries this embeddings database on-demand, and passes that data to the LLM as context. Embeddings make up one part of Sourcegraph’s code graph.

For users who use Cody for free, embeddings are available for Open Source projects through the Sourcegraph.com instance. Support for embeddings on private codes for individual users will be available in the near future.

For those with a Cody Enterprise subscription, your Sourcegraph Enterprise system will generate the embeddings specifically for your codebase.

Cody Enterprise

Cody Enterprise requires the use of a Sourcegraph Enterprise instance, and gives you access to AI coding tools across your entire organization. Contact us to set up a trial of Cody Enterprise. If you’re an existing Sourcegraph Enterprise customer, contact your technical advisor.

Feedback

License

Cody's code is open source (Apache License 2.0).

Code Search features

  • Search with Sourcegraph directly from inside the IDE
  • Instantly search in all open source repos and your private code
  • Peek into any remote repo in the IDE, without checking it out locally

URL sharing features

  • Create URLs to specific code blocks to share them with your teammates
  • Open your files on Sourcegraph

Supported IDEs JetBrains Plugin

The plugin works with all JetBrains IDEs, including:

  • IntelliJ IDEA
  • IntelliJ IDEA Community Edition
  • PhpStorm
  • WebStorm
  • PyCharm
  • PyCharm Community Edition
  • RubyMine
  • AppCode
  • CLion
  • GoLand
  • DataGrip
  • Rider
  • Android Studio

Versions 2022+ Recommended

Exception: Due to a Java bug, search doesn't work with IDE versions 2021.1 and 2021.2 for users with Apple Silicone CPUs.

Installation

  • Open settings
    • Windows: Go to File | Settings (or use Ctrl+Alt+S)
    • Mac: Go to IntelliJ IDEA | Preferences (or use ⌘,)
  • Click Plugins in the left-hand pane, then the Marketplace tab at the top
  • Search for Sourcegraph, then click the Install button
  • Make sure that the git command is available in your PATH. We’re going to get rid of this dependency, but for now, the plugin relies on it.
  • Restart your IDE if needed
  • To search with Sourcegraph, press Alt+S (⌥S on Mac).
  • To share a link to your code or search through the website, right-click in the editor, and choose an action under the Sourcegraph context menu item.
  • To use your private Sourcegraph instance, open Settings | Tools | Sourcegraph and enter your URL and access token.

Settings

List of in-app settings and how to use them

  • Authorization: List of accounts that can be used to interact with the plugin. Each account can be configured with:
    • Server: The URL of your Sourcegraph instance. It can be configured with your private instance if you're adding an enterprise account.
    • Token: See our user docs for a video guide on how to create an access token.
    • Custom request headers: Any custom headers to send with every request to Sourcegraph.
      • Use any number of pairs: header1, value1, header2, value2, ....
      • Example: Authorization, Bearer 1234567890, X-My-Header, My-Value.
      • Whitespace around commas doesn't matter.
  • Default branch name: The branch to use if the current branch is not yet pushed to the remote.
    • Usually "main" or "master", but can be any name
  • Remote URL replacements: You can replace specific strings in your repo's remote URL.
    • Use any number of pairs: search1, replacement1, search2, replacement2, ....
    • Pairs are replaced from left to right. Whitespace around commas doesn't matter.
    • Important: The replacements are done on the Git remote-formatted URL, not the URL you see in the browser!
      • Example replacement subject for Git: [email protected]:sourcegraph/sourcegraph.git
      • Example replacement subject for Perforce: [email protected]:depot-name.perforce
      • Anatomy of the replacement subjects:
        • The username is not used.
        • Between the @ and the : is the hostname
        • After the : is the organization/repo name (for Git) or the depot name (for Perforce)
        • The .git / .perforce extension is not used.
      • When you do the replacements, make sure you keep the colon.
      • In the case of a custom repositoryPathPattern being set for your code host in your private Sourcegraph instance, you may try to set up a pattern that uses the @, :, and .git/.perforce boundaries, or specify a replacement pair for each repo or each depot you may have. If none of these solutions work for you, please raise this at [email protected], and we'll prioritize making this more convenient.
  • Globbing: Determines whether you can specify sets of filenames with wildcard characters.
  • Cody completions: Enables/disables Cody completions in the editor.
    • The completions are disabled by default.

Git remote setting

By default, the plugin will use the git remote called origin to determine which repository on Sourcegraph corresponds to your local repository. If your origin remote doesn't match Sourcegraph, you may instead configure a Git remote by the name of sourcegraph. It will take priority when creating Sourcegraph links.

Setting levels

You can configure the plugin on three levels:

  1. Project-level On the project level you are able to configure your default account, default branch name and remote url replacements
  2. Application-level All other settings are stored here

Managing Custom Keymaps

A screenshot of the JetBrains preferences panel inside the Keymap tab

You can configure JetBrains to set custom keymaps for Sourcegraph actions:

  1. Open the JetBrains preferences panel and go to the Keymap page.
  2. Filter by "sourcegraph" to see actions supplied by this plugin.
  3. Now select an option to overwrite the keymap information and supply the new bindings.

Questions & Feedback

If you have any questions, feedback, or bug report, we appreciate if you open an issue on GitHub.

Uninstallation

  • Open settings
    • Windows: Go to File | Settings (or use Ctrl+Alt+S)
    • Mac: Go to IntelliJ IDEA | Preferences (or use ⌘,)
  • Click Plugins in the left-hand pane, then the Installed tab at the top
  • Find Sourcegraph → Right click → Uninstall (or uncheck to disable)

jetbrains's People

Contributors

vdavid avatar olafurpg avatar philipp-spiess avatar gedochao avatar mkondratek avatar strum355 avatar valerybugakov avatar gitstart-sourcegraph avatar exigow avatar sa1to avatar limitedmage avatar jbedard avatar taras-yemets avatar sqs avatar dadlerj avatar bolajiolajide avatar fkling avatar keegancsmith avatar umpox avatar willdollman avatar vovakulikov avatar mrnugget avatar tbliu98 avatar kalanchan avatar gregmagolan avatar eseliger avatar danielmarquespt avatar cbart avatar iskyos avatar akalia25 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.