Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding clickble symbol render in chat panel #3420

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Sma1lboy
Copy link
Collaborator

@Sma1lboy Sma1lboy commented Nov 14, 2024

still working

demo

Screen.Recording.2024-11-16.at.14.16.36.mov

@@ -94,6 +105,7 @@ export function createClient(target: HTMLIFrameElement, api: ClientApi): ServerA
onLoaded: api.onLoaded,
onCopy: api.onCopy,
onKeyboardEvent: api.onKeyboardEvent,
onRenderLsp: api.onRenderLsp,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onRenderLsp: api.onRenderLsp,
onNavigateSymbol: api.onNavigateSymbol,

@@ -53,7 +53,14 @@ export interface ServerApi {
updateTheme: (style: string, themeClass: string) => void
updateActiveSelection: (context: Context | null) => void
}

export interface KeywordInfo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export interface KeywordInfo {
export interface SymbolInfo {

export interface KeywordInfo {
sourceFile: string
sourceLine: number
sourceChar: number
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sourceChar: number
sourceCol: number

@wsxiaoys wsxiaoys changed the title feat: adding clickble keyword render in chat panel feat: adding clickble symbol render in chat panel Nov 18, 2024
@@ -69,6 +76,10 @@ export interface ClientApi {
onCopy: (content: string) => void

onKeyboardEvent: (type: 'keydown' | 'keyup' | 'keypress', event: KeyboardEventInit) => void
onRenderLsp: (filepaths: string[], keywords: string[]) => Promise<Record<
Copy link
Member

@wsxiaoys wsxiaoys Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onRenderLsp: (filepaths: string[], keywords: string[]) => Promise<Record<
onNavigateSymbol: (filepath: String, symbol: String) => void

Instead of return SymbolInfo, why not just navigate to the symbol directly?

@wsxiaoys
Copy link
Member

Need handle cases that certain backend doesn't support such feature (e.g IntelliJ)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants