Skip to content

Commit

Permalink
refactor(error-handling): remove temporary error handling code #329
Browse files Browse the repository at this point in the history
- Delete unused error handling files and related code.
- Simplify `FixThisAction` by removing dependency on deleted error handling utilities.
- Update README.md to reflect license changes and remove outdated references.
  • Loading branch information
phodal committed Mar 10, 2025
1 parent 56e3acf commit bdcc7a4
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 642 deletions.
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,34 +163,15 @@ Welcome to add your company here.

## License

Regarding the matter discussed in the LICENSE issue at the project's outset, we want to address the complexity of
JetBrain plugin development. In the process, we referenced certain code and API designs from the JetBrains Community
version and the JetBrains AI Assistant plugin. JetBrains understandably reserves the right to view this as potential
infringement on their intellectual property.
Inspired by:

Therefore, as of April 2024, AutoDev is no longer available on the JetBrains Plugin Marketplace. However, for older
versions' AutoDev, you can access downloads from our Releases page.

Additionally, we extend a warm invitation to participate in the development of the VSCode version. Your contributions
are greatly appreciated.

- ChatUI based
on: [https://github.com/Cspeisman/chatgpt-intellij-plugin](https://github.com/Cspeisman/chatgpt-intellij-plugin)
- Multiple target inspired
by: [https://github.com/intellij-rust/intellij-rust](https://github.com/intellij-rust/intellij-rust)
- SimilarFile inspired by: JetBrains and GitHub Copilot
- SimilarFile inspired by: GitHub Copilot
- DevIn Language refs
on [JetBrains' Markdown Util](https://github.com/JetBrains/intellij-community/tree/master/platform/markdown-utils),
which is licensed under the Apache 2.0 license.
- Stream Diff based on [Continue Dev](https://github.com/continuedev/continue) under the Apache 2.0 license.
- Ripgrep inspired by [Cline](https://github.com/cline/cline) under the Apache 2.0 license.

**Known License issues**: JetBrain plugin development is no walk in the park! Oops, we cheekily borrowed some code from
the JetBrains Community version and the super cool JetBrains AI Assistant plugin in our codebase.
But fret not, we are working our magic to clean it up diligently! 🧙‍♂️✨.

Those codes will be removed in the future, you
can check it in `src/main/kotlin/com/intellij/temporary`, if you want to use this plugin in your company,
please remove those codes to avoid any legal issues.

This code is distributed under the MPL 2.0 license. See `LICENSE` in this directory.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ import cc.unitmesh.devti.settings.locale.LanguageChangedCallback.presentationTex
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.diagnostic.logger
import com.intellij.temporary.error.ErrorDescription
import com.intellij.temporary.error.ErrorMessageProcessor
import com.intellij.temporary.error.ErrorPromptBuilder


class FixThisAction : ChatBaseAction() {
init{
init {
presentationText("settings.autodev.others.fixThis", templatePresentation)
}

Expand All @@ -26,22 +24,14 @@ class FixThisAction : ChatBaseAction() {
val project = event.project ?: return
val prompt: TextTemplatePrompt?

val description: ErrorDescription? = ErrorMessageProcessor.getErrorDescription(event)
if (description == null) {
val editor = event.getData(CommonDataKeys.EDITOR) ?: return
val text = editor.selectionModel.selectedText ?: return

prompt = ErrorPromptBuilder.buildDisplayPrompt(text, text, "Fix this")
} else {
prompt = ErrorMessageProcessor.extracted(project, description)
if (prompt == null) {
logger.error("Prompt is null, description: $description")
return
}
}
val editor = event.getData(CommonDataKeys.EDITOR) ?: return
val selectionModel = editor.selectionModel
val text = selectionModel.selectedText ?: return

prompt = ErrorPromptBuilder.buildDisplayPrompt(text, text, "Fix this")

if (prompt.displayText.isBlank() || prompt.requestText.isBlank()) {
logger.error("Prompt is null, description: $description")
logger.error("Prompt is null, description: $text")
return
}

Expand Down
202 changes: 0 additions & 202 deletions core/src/main/kotlin/com/intellij/temporary/LICENSE.txt

This file was deleted.

This file was deleted.

Loading

0 comments on commit bdcc7a4

Please sign in to comment.