Connecting an AI assistant to an enterprise codebase shouldn't feel like negotiating a hostage crisis between your IDE and your corporate proxy. Yet when engineering teams deploy Sourcegraph Cody across JetBrains environments—whether IntelliJ IDEA, PyCharm, WebStorm, or GoLand—they routinely hit two immediate walls: keystroke race conditions that garble code completion, and authentication hurdles when linking self-hosted Sourcegraph instances.
At 365Finds, our testing across enterprise multi-repo architectures revealed a clear reality: Sourcegraph Cody delivers exceptional deep-context intelligence across distributed services, but its default configuration in JetBrains IDEs leads straight into an ergonomic mess unless you deliberately adjust your completion settings. Two AI engines fighting for the Tab key will ruin your workflow in ten minutes.
Here is the exact technical configuration required to connect private enterprise instances, configure remote repository contexts, and eliminate completion conflicts in JetBrains IDEs.
1. The Core Conflict: Why JetBrains and Sourcegraph Cody Clash
Starting with JetBrains 2024.1, JetBrains IDEs ship with native Full Line code completion enabled by default. This feature runs a local deep-learning model on your CPU or GPU to generate single-line gray ghost text, accepted by pressing Tab.
At the same time, Sourcegraph Cody runs its own cloud-backed multi-line autocomplete engine, which also proposes ghost text and binds to Tab.
Keystroke Event: [Tab]
│
├─► JetBrains Full Line Engine (Local Model) ──► Insert 1 line
└─► Sourcegraph Cody (Remote LLM) ──► Insert multi-line block
Result: Partial insertions, cursor misplacement, and duplicated closing brackets.
When both systems run simultaneously without configuration, you encounter severe friction:
- Ghost text flickering: The editor flashes conflicting predictions as the local model and remote Cody model race to render suggestions.
- Accidental line truncation: Pressing
Tabaccepts JetBrains' local one-line completion while discarding Cody's multi-line function synthesis. - Popup hijacking: JetBrains' traditional structural popup completion (
Ctrl+Space) collides with Cody's inline suggestions, causing unwanted parameter insertion.
At 365Finds, we take a definitive stance: Do not let two inline AI engines compete for Tab. If your organization pays for Sourcegraph Cody to leverage enterprise code graph awareness, give Cody exclusive domain over inline ghost text, while retaining JetBrains' native popup completion for strict symbol lookups.
2. Step-by-Step: Connecting JetBrains to an Enterprise Sourcegraph Instance
Before fixing completion collisions, you must properly bind your IDE to your company's self-hosted or managed Sourcegraph Enterprise instance.
Step 2.1: Generate an Enterprise Access Token
- Open your browser and navigate to your internal Sourcegraph instance (for example,
https://sourcegraph.corp.internal). - Log in through your corporate SSO (Okta, GitHub Enterprise, GitLab, or SAML).
- Click your profile avatar in the upper right corner and select Settings.
- In the left navigation, select Access tokens (under User Settings).
- Click Generate new token. Enter an identifiable description (e.g.,
IntelliJ-Cody-Token) and set an expiration date in accordance with your internal security policies. - Click Generate and immediately copy the token value (
sgp_...).
Step 2.2: Install the Plugin and Authenticate
- In your JetBrains IDE, open settings via
Ctrl+Alt+S(Windows/Linux) orCmd+,(macOS). - Go to Plugins, select the Marketplace tab, search for
Cody: AI Coding Assistant with Autocomplete & Chat, and click Install. Restart the IDE if prompted. - In settings, navigate to Tools | Sourcegraph (or Tools | Cody depending on the plugin build).
- In the authorization configuration:
- Change the instance endpoint from the default
https://sourcegraph.comto your organization's private instance URL (e.g.,https://sourcegraph.corp.internal). - Paste the Access Token copied in Step 2.1.
- Change the instance endpoint from the default
- Click Apply and then OK. The Cody status bar icon should switch from disconnected to active.
| Setting Field | Default Cloud Value | Enterprise Target Value |
|---|---|---|
| Instance URL | https://sourcegraph.com | https://sourcegraph.corp.internal |
| Auth Method | Web Browser OAuth | Personal Access Token (sgp_...) |
| Codebase Scope | Current Repo Only | Multi-repo Enterprise Index |
3. Resolving Completion Conflicts: Three Configuration Strategies
To eliminate autocomplete collisions, choose one of the following three architectural setups based on your team's workflow requirements.
Completion Architecture Trade-offs:
Approach A (365Finds Recommended)
┌────────────────────────────────────────────────────────┐
│ Inline Ghost Text: Sourcegraph Cody (Multi-line LLM) │
│ Structural Symbols: JetBrains Native Popup (Ctrl+Space)│
│ Local Full Line: DISABLED │
└────────────────────────────────────────────────────────┘
Approach B (Dual-Engine Separation)
┌────────────────────────────────────────────────────────┐
│ Inline Ghost Text: JetBrains Local Full Line (Tab) │
│ Advanced Synthesis: Sourcegraph Cody (Rebound to Alt+\)│
└────────────────────────────────────────────────────────┘
Approach A: The 365Finds Recommended Setup (Cody Exclusive Inline)
This configuration disables JetBrains' local neural completions to provide a unified, predictable experience driven by Cody's enterprise-aware models.
- Open Settings / Preferences (
Ctrl+Alt+SorCmd+,). - Navigate to Editor | General | Code Completion.
- Under the Machine Learning-Assisted Completion section:
- Uncheck Enable Full line suggestions.
- Alternatively, under Plugins | Installed, uncheck and disable the bundled Full Line Code Completion plugin.
- If your IDE has JetBrains AI Assistant installed, either disable the plugin or disable its inline completion toggle to prevent a three-way collision.
- Under Editor | General | Code Completion, look for Inline Completion:
- Ensure
Insert with Tabis reserved for your primary inline provider.
- Ensure
- Result: Cody owns inline gray text and multiline code generation on
Tab. JetBrains retains traditional code intelligence (imports, type checking, method signatures) onCtrl+SpaceandEnter.
Approach B: Coexistence via Keymap Rebinding
If your organization mandates local-only completions for basic typing but permits Cody for complex blocks, rebind the acceptance trigger:
- Open Settings / Preferences | Keymap.
- Search for
Cody: Accept AutocompleteorAccept Inline Proposal. - Right-click the action, select Add Keyboard Shortcut, and assign an alternative keystroke—such as
Right Arrow(→),Alt+Enter, orCtrl+Alt+Y. - Remove the
Tabbinding from Cody. - In this mode, pressing
Tabaccepts JetBrains' native local completion, while pressing your custom shortcut accepts Cody's multi-line code block.
Approach C: Chat-Only Mode (Autocomplete Disabled)
For developers working in air-gapped repositories with strict latency constraints or zero cloud-completion tolerance:
- Click the Cody status icon in the JetBrains bottom status bar.
- Uncheck Enable Autocomplete.
- Cody remains fully functional for codebase-wide chat, inline refactoring (
Ctrl+Shift+Gor Cody context actions), unit test generation, and symbol lookups, while leaving JetBrains' native code completion untouched.
4. Connecting and Querying Enterprise Codebases
Authenticating the plugin is only half the battle. Cody's primary commercial value lies in its ability to retrieve context across hundreds of remote microservices without requiring you to clone them locally.
Step 4.1: Repository Verification and Remote Matching
Cody automatically checks your workspace's local Git configuration:
git remote -v
# origin git@github.corp.internal:platform/payment-service.git (fetch)
If this remote origin matches a repository already cloned and indexed by your Sourcegraph Enterprise instance, Cody automatically binds search embeddings and the code graph to your active IDE session.
Step 4.2: Querying Remote Repositories via @-Mentions
When debugging inter-service contracts, internal APIs, or shared schemas, you do not need the dependent repository open in your project window.
- Open the Cody chat panel via the sidebar or
Alt+S. - Type
@in the chat input. - Select Repositories from the dropdown menu.
- Search for your remote enterprise repository (for example,
@platform/auth-contractsor@shared/database-models). - Enter your prompt:
@shared/database-models How does the UserSession entity handle token expiration, and how should our payment service validate it?
Sourcegraph Cody executes remote search vectors on your enterprise server and streams contextual references directly into your JetBrains session.
5. Troubleshooting Common Enterprise Hurdles
In enterprise rollouts, standard setups frequently stumble over corporate network security. Here is how 365Finds resolves the two most common failures:
Issue 1: SSL Handshake and Self-Signed Certificate Errors
- Symptom: The Cody plugin shows a red disconnect indicator; IDE logs report
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException. - Root Cause: Your enterprise routes HTTPS traffic through an internal TLS proxy or uses an internal corporate Certificate Authority (CA) not present in the bundled JetBrains Java runtime truststore.
- Fix:
- Open Settings | Tools | Server Certificates.
- Check Accept non-trusted certificates automatically (if compliant with company rules) OR click the
+icon under Custom Certificates and import your company's root.crt/.pemcertificate. - Restart the JetBrains IDE.
Issue 2: Remote Context Not Resolving
- Symptom: Typing
@repoyields no suggestions or returns "Repository not found." - Root Cause: Your personal access token lacks repository indexing read permissions, or the repository has not completed Sourcegraph server-side search indexing.
- Fix: Log into the Sourcegraph Enterprise web console. Navigate to the target repository and verify that its status is
Indexed. Ensure your user account belongs to an organization team with read permissions for that repository.
6. The 365Finds Assessment
Sourcegraph Cody provides genuine multi-repository enterprise search in a way that local IDE completion engines simply cannot replicate. Being able to pull precise code patterns from five un-cloned microservices inside an IntelliJ chat session saves real engineering hours every week.
However, the onboarding friction in JetBrains is unnecessarily steep. Out of the box, Cody does not detect the active presence of JetBrains Full Line completion, leaving developers to figure out why their Tab key is behaving erratically. Disabling JetBrains Full Line completion and binding Cody to an enterprise token transforms a chaotic keystroke war into a cohesive development environment.