Skip to content

Commit

Permalink
refactor(chunks): move similar chunks to inlay package #329
Browse files Browse the repository at this point in the history
- Rename and relocate `SimilarChunkContext` and `SimilarChunksWithPaths` to `cc.unitmesh.devti.inlay.chunks`.
- Update imports across multiple files to reflect the new package structure.
- Remove unused `LineSpacingExtension` from `MarkdownViewer`.
  • Loading branch information
phodal committed Mar 10, 2025
1 parent d549389 commit 56e3acf
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cc.unitmesh.devti.custom.variable

import com.intellij.openapi.application.ReadAction
import com.intellij.psi.PsiElement
import com.intellij.temporary.similar.chunks.SimilarChunksWithPaths
import cc.unitmesh.devti.inlay.chunks.SimilarChunksWithPaths

class SimilarChunkVariableResolver(val element: PsiElement) : VariableResolver {
override val type: CustomResolvedVariableType get() = CustomResolvedVariableType.SIMILAR_CHUNK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 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.
package com.intellij.temporary.similar.chunks
package cc.unitmesh.devti.inlay.chunks

import cc.unitmesh.devti.context.base.LLMCodeContext
import com.intellij.lang.Language
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// 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.
package com.intellij.temporary.similar.chunks
package cc.unitmesh.devti.inlay.chunks

import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.diagnostic.logger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cc.unitmesh.devti.intentions.action.task

import cc.unitmesh.devti.AutoDevBundle
import com.intellij.temporary.similar.chunks.SimilarChunksWithPaths
import cc.unitmesh.devti.inlay.chunks.SimilarChunksWithPaths
import cc.unitmesh.devti.llms.LlmFactory
import cc.unitmesh.devti.util.AutoDevCoroutineScope
import cc.unitmesh.devti.intentions.action.CodeCompletionBaseIntention
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cc.unitmesh.devti.intentions.action.task

import cc.unitmesh.devti.settings.AutoDevSettingsState
import com.intellij.temporary.similar.chunks.SimilarChunksWithPaths
import cc.unitmesh.devti.inlay.chunks.SimilarChunksWithPaths
import com.intellij.lang.LanguageCommenters

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cc.unitmesh.devti.sketch.ui.code

import com.intellij.openapi.editor.colors.EditorColorsManager
import com.intellij.openapi.util.text.StringUtil
import com.intellij.temporary.gui.block.LineSpacingExtension
import com.intellij.ui.BrowserHyperlinkListener
import com.intellij.ui.ColorUtil
import com.intellij.util.ui.HTMLEditorKitBuilder
Expand All @@ -14,10 +13,7 @@ object MarkdownViewer {
fun createBaseComponent(): JEditorPane {
val jEditorPane = JEditorPane()
jEditorPane.setContentType("text/html")
val htmlEditorKit = HTMLEditorKitBuilder()
.withViewFactoryExtensions(
LineSpacingExtension(0.2f)
).build()
val htmlEditorKit = HTMLEditorKitBuilder().build()

val backgroundColor = UIUtil.getPanelBackground()
val schemeForCurrentUITheme = EditorColorsManager.getInstance().schemeForCurrentUITheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiManager
import com.intellij.temporary.similar.chunks.SimilarChunksWithPaths
import cc.unitmesh.devti.inlay.chunks.SimilarChunksWithPaths
import kotlinx.coroutines.runBlocking

open class JavaContextPrompter : ContextPrompter() {
Expand Down

0 comments on commit 56e3acf

Please sign in to comment.