Skip to content

Commit 6652000

Browse files
committed
refactor(gui): move GUI components to unitmesh package
Relocate GUI-related files from temporary package to cc.unitmesh.devti.gui. Also add error handling in markdown conversion to prevent crashes when parsing fails. This aligns with the project's new package structure and improves robustness.
1 parent 7ef0407 commit 6652000

File tree

8 files changed

+17
-13
lines changed

8 files changed

+17
-13
lines changed

core/src/223/main/kotlin/com/intellij/temporary/gui/block/AutoDevCoolBorder.kt renamed to core/src/223/main/kotlin/cc/unitmesh/devti/gui/AutoDevCoolBorder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2-
package com.intellij.temporary.gui.block
2+
package cc.unitmesh.devti.gui
33

44
import com.intellij.ide.ui.laf.darcula.DarculaUIUtil
55
import com.intellij.openapi.editor.Editor

core/src/223/main/kotlin/com/intellij/temporary/inlay/presentation/LLMTextInlayPainter.kt renamed to core/src/223/main/kotlin/cc/unitmesh/devti/gui/LLMTextInlayPainter.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.intellij.temporary.inlay.presentation
1+
package cc.unitmesh.devti.gui
22

3-
import com.intellij.temporary.inlay.presentation.PresentationUtil.fontMetrics
4-
import com.intellij.temporary.inlay.presentation.PresentationUtil.getFont
5-
import com.intellij.temporary.inlay.presentation.PresentationUtil.getThemeInfoProvider
3+
import cc.unitmesh.devti.gui.PresentationUtil.fontMetrics
4+
import cc.unitmesh.devti.gui.PresentationUtil.getFont
5+
import cc.unitmesh.devti.gui.PresentationUtil.getThemeInfoProvider
66
import com.intellij.codeInsight.codeVision.ui.model.RangeCodeVisionModel
77
import com.intellij.codeInsight.codeVision.ui.renderers.painters.ICodeVisionEntryBasePainter
88
import com.intellij.openapi.editor.Editor

core/src/223/main/kotlin/com/intellij/temporary/inlay/presentation/PresentationUtil.kt renamed to core/src/223/main/kotlin/cc/unitmesh/devti/gui/PresentationUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.intellij.temporary.inlay.presentation
1+
package cc.unitmesh.devti.gui
22

33
import com.intellij.codeInsight.codeVision.ui.renderers.painters.CodeVisionThemeInfoProvider
44
import com.intellij.codeWithMe.ClientId

core/src/233/main/kotlin/com/intellij/temporary/gui/block/AutoDevCoolBorder.kt renamed to core/src/233/main/kotlin/cc/unitmesh/devti/gui/AutoDevCoolBorder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2-
package com.intellij.temporary.gui.block
2+
package cc.unitmesh.devti.gui
33

44
import com.intellij.ide.ui.laf.darcula.DarculaUIUtil
55
import com.intellij.openapi.editor.Editor

core/src/233/main/kotlin/com/intellij/temporary/inlay/presentation/LLMTextInlayPainter.kt renamed to core/src/233/main/kotlin/cc/unitmesh/devti/gui/LLMTextInlayPainter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.intellij.temporary.inlay.presentation
1+
package cc.unitmesh.devti.gui
22

33
import com.intellij.codeInsight.codeVision.CodeVisionEntry
44
import com.intellij.codeInsight.codeVision.ui.model.RangeCodeVisionModel

core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputSection.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import com.intellij.openapi.wm.IdeFocusManager
4545
import com.intellij.openapi.wm.impl.InternalDecorator
4646
import com.intellij.psi.PsiElement
4747
import com.intellij.psi.PsiManager
48-
import com.intellij.temporary.gui.block.AutoDevCoolBorder
48+
import cc.unitmesh.devti.gui.AutoDevCoolBorder
4949
import com.intellij.ui.HintHint
5050
import com.intellij.ui.MutableCollectionComboBoxModel
5151
import com.intellij.ui.SimpleListCellRenderer

core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/presentation/LLMInlayRenderer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.intellij.openapi.editor.Editor
44
import com.intellij.openapi.editor.EditorCustomElementRenderer
55
import com.intellij.openapi.editor.Inlay
66
import com.intellij.openapi.editor.markup.TextAttributes
7-
import com.intellij.temporary.inlay.presentation.LLMTextInlayPainter
7+
import cc.unitmesh.devti.gui.LLMTextInlayPainter
88
import java.awt.Graphics
99
import java.awt.Rectangle
1010

core/src/main/kotlin/cc/unitmesh/devti/util/parser/MarkdownToHtmlConverter.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import org.intellij.markdown.parser.MarkdownParser
1010
private val embeddedHtmlType = IElementType("ROOT")
1111

1212
fun convertMarkdownToHtml(markdownText: String): String {
13-
val flavour = GFMFlavourDescriptor()
14-
val parsedTree = MarkdownParser(flavour).parse(embeddedHtmlType, markdownText)
15-
return HtmlGenerator(markdownText, parsedTree, flavour, false).generateHtml()
13+
try {
14+
val flavour = GFMFlavourDescriptor()
15+
val parsedTree = MarkdownParser(flavour).parse(embeddedHtmlType, markdownText)
16+
return HtmlGenerator(markdownText, parsedTree, flavour, false).generateHtml()
17+
} catch (e: Exception) {
18+
return markdownText
19+
}
1620
}

0 commit comments

Comments
 (0)