continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.31k stars 1.67k forks source link

Jetbrains db.search is not a function (Add Codebase to Chat) #2269

Closed scpedicini closed 1 month ago

scpedicini commented 2 months ago

Before submitting your bug report

Relevant environment info

- OS: MacOS Monterey 12.7.4
- Continue: 0.0.64
- IDE: Jetbrains Webstorm 2024.2.1
- Model: Claude Sonnet 3.5 (API Key supplied)
- config.json:

{
  "models": [
    {
      "model": "claude-3-5-sonnet-20240620",
      "contextLength": 200000,
      "title": "Claude 3.5 Sonnet",
      "apiKey": "sk-ant-******",
      "provider": "anthropic"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": "FAKE"
  },
  "model_roles": {
    "default": "LLM"
  },
  "system_message": "",
  "embeddingsProvider": {
    "provider": "free-trial"
  },
  "reranker": {
    "name": "free-trial"
  }
}

Description

Every time I use either ⌘-Enter in the Continue Chat or @codebase it throws Error getting context items from codebase: TypeError: db.search is not a function.

Here is the core.log file, it looks like it starts to index the codebase and then maybe just gives up at 50%? I've replicated this issue on every project I've tried so I don't think its tied to a specific one.

info] Starting Continue core...
[2024-09-15T15:17:15] [info] Starting Continue core... 
[2024-09-15T15:17:15] Setup 
[2024-09-15T15:17:15] Core started 
[2024-09-15T15:17:15] Indexing: 0.0% complete, elapsed time: 0s, NaN file/sec 
[2024-09-15T15:17:15] Indexing: 25.0% complete, elapsed time: 0s, Infinity file/sec 
[2024-09-15T15:17:15] Indexing: 25.0% complete, elapsed time: 0s, Infinity file/sec 
[2024-09-15T15:17:16] Indexing: 25.0% complete, elapsed time: 1s, 1.00 file/sec 
[2024-09-15T15:17:16] Indexing: 50.0% complete, elapsed time: 1s, 3.00 file/sec 
[2024-09-15T15:17:16] Indexing: 50.0% complete, elapsed time: 1s, 3.00 file/sec 
[2024-09-15T15:17:16] Indexing: 50.0% complete, elapsed time: 1s, 3.00 file/sec 
[2024-09-15T15:17:16] Indexing: 50.0% complete, elapsed time: 1s, 3.00 file/sec 

Looking at the index.sqlite SQLite file I can see it that it has chunked the right files.

583,aa34fd12b3fff393a191d4b86ad32340c0ccab26276530b4c588a5a3c5b262ce,/Users/shaun/dev/other/webstorm-continue-test/src/greeter.ts,1,0,19,"class Student {
    fullName: string;
    constructor(public firstName, public middleInitial, public lastName) {
        this.fullName = firstName + "" "" + middleInitial + "" "" + lastName;
    }
}

interface Person {
    firstName: string;
    lastName: string;
}

function greeter(person : Person) {
    return ""Hello, "" + person.firstName + "" "" + person.lastName;
}

var user = new Student(""Jane"", ""M."", ""User"");

document.body.innerHTML = greeter(user);
"

Adding actual files / active file / etc works fine - but any attempts to use @codebase give this error, is it possibly related to the Lance vector database?

I've also added the Continue extension to VSCodium and codebase context works fine. It seems directly related to the Jetbrains Webstorm extension.

ALSO: Trying to visit the troubleshooting documentation at https://docs.continue.dev/troubleshooting results in infinite redirects.

To reproduce

  1. Create a new sample project folder with any code
  2. Install Continue plugin into Webstorm
  3. Open folder using Webstorm
  4. Wait for logs (Core) to indicate it has finished indexing/etc.
  5. Open Continue sidebar
  6. Ask question and append codebase
  7. Observe db.search is not a function error

Log output

No response

scpedicini commented 2 months ago

I think we can probably close this issue out, although the infinite redirect to the Troubleshooting page persists:

https://docs.continue.dev/troubleshooting

Attempted the following to fix.

Steps to fix:

  1. Completely uninstall plugin (VSCodium, Jetbrains)
  2. Manually delete the ~/.continue folder.
  3. Install the EAP plugin (0.0.68) in Jetbrains Webstorm

This addresses the error Error retrieving from FTS: Error: SQLITE_ERROR: no such table: fts referenced here:

https://github.com/continuedev/continue/issues/2089

  1. Logs now show a reference to being unable to find MiniLM
  2. Searching across Continue docs shows that MiniLM is only supported in VSCode
  3. Manually add ollama nomic embeddings provider to config.json
"embeddingsProvider": {
    "provider": "ollama",
    "model": "nomic-embed-text"
}
  1. Restart Webstorm
  2. Open project and wait for indexing to finish
  3. Ask question with @codebase
  4. Observe it correctly adds the context related files
bigyoo commented 2 months ago

I had the same issue and I was able to resolve it by deleting the local sqlite database. So try the following steps:

  1. Shutdown Webstorm
  2. Remove these two file: ~\.continue\index\index.sqlite and ~\.continue\index\index.sqlite-wal
  3. Restart Webstorm and let Continue to rebuild the index.
scpedicini commented 1 month ago

Looks like the infinite redirect issue was fixed - so I'm going to close this issue out.