feat: psi structure for chat (#897)

* Change SwingDispatcher to Dispatchers.Main.immediate

* Change PSI analyzer package

* Added a blank for PSI analysis in the chat

* Add support for code structure analysis and improve tag management

- Refactor TagManager to use thread-safe collections
- Add support for new tag types (EditorTagDetails, FileTagDetails)
- Update UI components to handle structure analysis
- Add new icon for structure tags

* Refactoring tags v2

* Add PSI structure to chat settings

* Add VirtualFile to ClassStructure and improve PSI token tracking

* Support passing PSI structure to completion requests

* Add removeListener method to TagManager and fix memory leak

* Update buildOpenAIMessages to support PSI structure for all providers

* Add selected editor tag when initializing user input header

* Add chat settings configuration screen

* Remove unused editor tag and PSI structure settings panels

---------

Co-authored-by: a.iudin <a.iudin@vk.team>
This commit is contained in:
Aleksandr 2025-03-11 20:57:55 +03:00 committed by GitHub
parent 97185109ad
commit 7d472e8cf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 1185 additions and 444 deletions

View file

@ -147,6 +147,11 @@ configurationConfigurable.section.codeCompletion.gitDiff.title=Enable git diff c
configurationConfigurable.section.codeCompletion.collectDependencyStructure.title=Enable dependency analyzer
configurationConfigurable.section.codeCompletion.collectDependencyStructure.description=Enabling the setting allows the plugin to collect the dependency structure, which increases the accuracy of the proposed data, but consumes more tokens per request. Currently, it is implemented only for the Kotlin language.
configurationConfigurable.section.codeCompletion.gitDiff.description=If checked, the user's most recent unstaged git diff will be included when requesting completion.
chatConfigurationConfigurable.displayName=ProxyAI: Chat Settings
chatConfigurationConfigurable.editorContextTag.title=Enable editor context tags
chatConfigurationConfigurable.editorContextTag.description=If enabled, open files in the editor will be added to the chat tags.
chatConfigurationConfigurable.psiStructure.title=Enable dependency structure analysis of attached files.
chatConfigurationConfigurable.psiStructure.description=If enabled, the class structure that is present in the imports of the attached files will be added in the context of the dialog. A structure refers to the source code in files that include constructors, fields, and methods, with all modifiers, arguments, and return types, but without an implementation. The implementation of dependencies is intentionally excluded in order to find a balance between a high-quality chat context and saving tokens.
settingsConfigurable.service.llama.topK.label=Top K:
settingsConfigurable.service.llama.topK.comment=Limit the next token selection to the K most probable tokens (default: 40)
settingsConfigurable.service.llama.topP.label=Top P: