general

How Can the Declarations Feature in Tabby VS Code Plugin Be Improved for Python?

I'm using the declarations feature of the tabby VS Code plugin and have noticed that the declaration bodies for Python are minimal, often only containing the name of the function, class, or variable without additional context. This is not very helpful for code completion. I've tested with two separate Python files and observed this behavior. The test project and method are described in detail, and I've also looked into the collectDeclarationSnippets function in the tabby agent. Could there be a better way to calculate the symbol range or improve the feature for Python and other languages?

mo

moqi

Asked on Jun 24, 2024

The tabby-agent relies on VSCode's language support to determine the declaration range for tokens, which is why the range might be minimal for Python. It's strange that the Python LSP provides such a small range for declarations. Enhancing the feature might require parsing or regex for Python and other top languages. Establishing a test suite for the top 10 languages could be a good start, and if a language provides minimal content, it could be configured not to provide a definition by default. This approach could help improve the context for code completion.

Jun 24, 2024Edited by