continue icon indicating copy to clipboard operation
continue copied to clipboard

Jetbrains Integration Codebase Context Bug with FTS Database

Open mphilippnv opened this issue 1 year ago • 15 comments

Before submitting your bug report

Relevant environment info

- OS:Ubuntu 22.04 LTS
- Continue: 0.0.62
- IDE: Pycharm 2024.2
- Model: Claude 3.5 Sonnet
- config.json:
  
  {
  "systemMessage": "You are a senior software developer who specializes in Python 3.11 with pydantic v2. You adhere to SOLID and DRY principles. You specialize in unit testing and refactors. Your unit tests should always be done with pytest and prefer using classes for tests. You always use static typing. You focus on performance, maintainability, readability and security. You always use existing docstrings and write new ones in the sphinx format, if needed. You favor pep 8 python formatting and you write method parameters on new lines.",
  "contextProviders": [
    {
      "name": "code"
    },
    {
      "name": "search"
    },
    {
      "name": "codebase"
    },
    {
      "name": "folder"
    },
    {
      "name": "url"
    },
    { "name": "diff" }
  ],
  "models": [
    {
      "model": "claude-3-5-sonnet-20240620",
      "contextLength": 200000,
      "title": "Claude 3.5 Sonnet",
      "apiKey": "REDACTED",
      "provider": "anthropic"
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Prefer creating classes for the tests. Give the tests just as chat output, don't edit any file. Use pytest with classes.",
      "description": "Write unit tests for highlighted code"
    },
    {
      "name": "integration_test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of integration tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Prefer creating classes for the tests. Give the tests just as chat output, don't edit any file. Use pytest with classes.",
      "description": "Write unit tests for highlighted code"
    },
    {
      "name": "doc",
      "prompt": "Write a docstring for the current code in sphinx format.  Do not add new code.",
      "description": "Write the docstring"
    },
    {
      "name": "review",
      "prompt": "Review this code and suggestion improvements if needed.",
      "description": "Review code"
    },
    {
      "name": "refactor",
      "prompt": "{{{ input }}}\n\nRefactor the selected code to improve its readability, maintainability, and performance.  Improving coupling, cohesion and efficiency.",
      "description": "Refactor the selected code"
    },
    {
      "name": "refactor_for_test",
      "prompt": "{{{ input }}}\n\nRefactor the selected code to improve its unit testability. SOLID principles should be followed and docstrings must be maintained. Prefer using Protocol instead of abstract classes for interfaces. If no refactor is needed, please write 'No refactor needed'.",
      "description": "Refactor the selected code"
    }
  ],
  "embeddingsProvider": {
    "provider": "ollama",
    "model": "nomic-embed-text"
  },
  "allowAnonymousTelemetry": true
}

Description

Whenever I try to use @codebase in a prompt, I get an error stating Error retrieving from FTS: Error: SQLITE_ERROR: no such table: fts. The notification in Pycharm shows Error getting context items from codebase: TypeError: db. search is not a function.

I have rebuilt the index and still have the same issue. Another user on Discord also reported this occurring in WebStorm. This leads me to think it's an issue with Jetbrains in general, not just PyCharm.

To reproduce

This assumes you have Pycharm installed with the Continue plugin enabled already.

  1. Open the Continue panel
  2. Make sure the project is indexed
  3. Write any prompt and include @codebase in the prompt. I recommend a prompt that refers to a file that has dependencies on other files.
  4. Submit the prompt
  5. Observe the error. The prompt still runs, but the automatic context isn't found.

Log output

[2024-08-23T18:12:33] Error retrieving from FTS: Error: SQLITE_ERROR: no such table: fts
[2024-08-23T18:13:58] Error retrieving from FTS: Error: SQLITE_ERROR: no such table: fts

mphilippnv avatar Aug 23 '24 18:08 mphilippnv