diff --git a/spx-gui/src/components/editor/code-editor/code-editor.ts b/spx-gui/src/components/editor/code-editor/code-editor.ts index 016fc2a34..3ea8fbb19 100644 --- a/spx-gui/src/components/editor/code-editor/code-editor.ts +++ b/spx-gui/src/components/editor/code-editor/code-editor.ts @@ -1,4 +1,4 @@ -import { DocumentDiagnosticReportKind } from 'vscode-languageserver-protocol' +import * as lsp from 'vscode-languageserver-protocol' import { Disposable } from '@/utils/disposable' import Emitter from '@/utils/emitter' import type { Runtime } from '@/models/runtime' @@ -18,14 +18,14 @@ import { type ChatExplainTargetCodeSegment, builtInCommandCopilotReview, type ChatTopicReview, - builtInCommandGoToDefinition + builtInCommandGoToDefinition, + type HoverContext, + type Hover } from './ui/code-editor-ui' import { - makeBasicMarkdownString, type Action, type DefinitionDocumentationItem, type DefinitionDocumentationString, - type DefinitionIdentifier, type Diagnostic, makeAdvancedMarkdownString, stringifyDefinitionId, @@ -39,7 +39,10 @@ import { type TextDocumentIdentifier, type ResourceIdentifier, fromLSPTextEdit, - textDocumentId2ResourceModelId + textDocumentId2ResourceModelId, + parseDefinitionId, + type Position, + type TextDocumentRange } from './common' import * as spxDocumentationItems from './document-base/spx' import * as gopDocumentationItems from './document-base/gop' @@ -104,6 +107,7 @@ class DiagnosticsProvider if (code[i] !== '\n') { offsetEnd = i + 1 adaptedByEnd = true + break } } if (!adaptedByEnd) { @@ -125,7 +129,8 @@ class DiagnosticsProvider const report = await this.lspClient.textDocumentDiagnostic({ textDocument: ctx.textDocument.id }) - if (report.kind !== DocumentDiagnosticReportKind.Full) throw new Error(`Report kind ${report.kind} not supported`) + if (report.kind !== lsp.DocumentDiagnosticReportKind.Full) + throw new Error(`Report kind ${report.kind} not supported`) for (const item of report.items) { const severity = item.severity == null ? null : fromLSPSeverity(item.severity) if (severity === null) continue @@ -140,10 +145,84 @@ class DiagnosticsProvider } } +class HoverProvider { + constructor( + private lspClient: SpxLSPClient, + private documentBase: DocumentBase + ) {} + + private async getExplainAction(lspHover: lsp.Hover) { + let definition: DefinitionDocumentationItem | null = null + if (!lsp.MarkupContent.is(lspHover.contents)) return null + // TODO: get definition ID from LS `textDocument/documentLink` + const matched = lspHover.contents.value.match(/def-id="([^"]+)"/) + if (matched == null) return null + const defId = parseDefinitionId(matched[1]) + definition = await this.documentBase.getDocumentation(defId) + if (definition == null) return null + return { + command: builtInCommandCopilotExplain, + arguments: [ + { + kind: ChatExplainKind.Definition, + overview: definition.overview, + definition: definition.definition + } + ] + } + } + + private async getGoToDefinitionAction(params: lsp.TextDocumentPositionParams) { + const lspClient = this.lspClient + const [definition, typeDefinition] = ( + await Promise.all([lspClient.textDocumentDefinition(params), lspClient.textDocumentTypeDefinition(params)]) + ).map((def) => { + if (def == null) return null + if (Array.isArray(def)) return def[0] + return def + }) + const location = definition ?? typeDefinition + if (location == null) return null + return { + command: builtInCommandGoToDefinition, + arguments: [ + { + textDocument: { uri: location.uri }, + range: fromLSPRange(location.range) + } satisfies TextDocumentRange + ] + } + } + + async provideHover(ctx: HoverContext, position: Position): Promise { + const lspParams = { + textDocument: ctx.textDocument.id, + position: toLSPPosition(position) + } + const lspHover = await this.lspClient.textDocumentHover(lspParams) + if (lspHover == null) return null + const contents: DefinitionDocumentationString[] = [] + if (lsp.MarkupContent.is(lspHover.contents)) { + // For now, we only support MarkupContent + contents.push(makeAdvancedMarkdownString(lspHover.contents.value)) + } + let range: Range | undefined = undefined + if (lspHover.range != null) range = fromLSPRange(lspHover.range) + const actions: Action[] = [] + for (const a of await Promise.all([this.getExplainAction(lspHover), this.getGoToDefinitionAction(lspParams)])) { + if (a != null) actions.push(a) + } + return { contents, range, actions } + } +} + export class CodeEditor extends Disposable { private copilot: Copilot private documentBase: DocumentBase private lspClient: SpxLSPClient + private resourceReferencesProvider: ResourceReferencesProvider + private diagnosticsProvider: DiagnosticsProvider + private hoverProvider: HoverProvider constructor( private project: Project, @@ -154,6 +233,9 @@ export class CodeEditor extends Disposable { this.copilot = new Copilot() this.documentBase = new DocumentBase() this.lspClient = new SpxLSPClient(project) + this.resourceReferencesProvider = new ResourceReferencesProvider(this.lspClient) + this.diagnosticsProvider = new DiagnosticsProvider(this.runtime, this.lspClient) + this.hoverProvider = new HoverProvider(this.lspClient, this.documentBase) } /** All opened text documents in current editor, by resourceModel ID */ @@ -226,9 +308,9 @@ export class CodeEditor extends Disposable { kind: item.kind, insertText: item.insertText, documentation: makeAdvancedMarkdownString(` - ${item.overview} - - `) + + +`) })) } }) @@ -285,8 +367,7 @@ export class CodeEditor extends Disposable { }) ui.registerCopilot(copilot) - - ui.registerDiagnosticsProvider(new DiagnosticsProvider(this.runtime, lspClient)) + ui.registerDiagnosticsProvider(this.diagnosticsProvider) ui.registerFormattingEditProvider({ async provideDocumentFormattingEdits(ctx) { @@ -295,68 +376,8 @@ export class CodeEditor extends Disposable { } }) - ui.registerHoverProvider({ - async provideHover(ctx, position) { - console.warn('TODO', ctx, position) - await new Promise((resolve) => setTimeout(resolve, 100)) - ctx.signal.throwIfAborted() - const range = ctx.textDocument.getDefaultRange(position) - const value = ctx.textDocument.getValueInRange(range) - if (value.trim() === '') return null - // TODO: get definition ID from LS - const definitionID: DefinitionIdentifier = { - package: 'github.com/goplus/spx', - name: `Sprite.${value}` - } - const definition = await documentBase.getDocumentation(definitionID) - const contents: DefinitionDocumentationString[] = [] - const actions: Action[] = [] - if (definition != null) { - contents.push( - makeAdvancedMarkdownString(` - ${definition.overview} - - `) - ) - actions.push({ - command: builtInCommandCopilotExplain, - arguments: [ - { - kind: ChatExplainKind.Definition, - overview: definition.overview, - definition: definition.definition - } - ] - }) - } - if (value === 'time') { - contents.push( - makeBasicMarkdownString(`var time int`) - ) - actions.push({ - command: builtInCommandGoToDefinition, - arguments: [ - { - textDocument: { - uri: `file:///main.spx` - }, - position: { - line: 2, - column: 2 - } - } - ] - }) - } - if (contents.length === 0) return null - return { - contents, - actions - } - } - }) - - ui.registerResourceReferencesProvider(new ResourceReferencesProvider(lspClient)) + ui.registerHoverProvider(this.hoverProvider) + ui.registerResourceReferencesProvider(this.resourceReferencesProvider) ui.registerDocumentBase(documentBase) } diff --git a/spx-gui/src/components/editor/code-editor/document-base/spx.ts b/spx-gui/src/components/editor/code-editor/document-base/spx.ts index d59d7f974..911b4dfbb 100644 --- a/spx-gui/src/components/editor/code-editor/document-base/spx.ts +++ b/spx-gui/src/components/editor/code-editor/document-base/spx.ts @@ -79,8 +79,8 @@ export const onTouchStart2: DefinitionDocumentationItem = { name: 'Sprite.onTouchStart', overloadId: '2' }, - insertText: 'onTouchStart ${1:name}, => {\n\t${2}\n}', - overview: 'onTouchStart name, => { ... }', + insertText: 'onTouchStart ${1:spriteName}, => {\n\t${2}\n}', + overview: 'onTouchStart spriteName, => { ... }', detail: makeBasicMarkdownString({ en: 'Listen to current sprite starting to be touched by sprite of given name', zh: '当前精灵与指定名字的精灵开始接触时执行' @@ -95,8 +95,8 @@ export const onTouchStart3: DefinitionDocumentationItem = { name: 'Sprite.onTouchStart', overloadId: '3' }, - insertText: 'onTouchStart ${1:name}, sprite => {\n\t${2}\n}', - overview: 'onTouchStart name, sprite => { ... }', + insertText: 'onTouchStart ${1:spriteName}, sprite => {\n\t${2}\n}', + overview: 'onTouchStart spriteName, sprite => { ... }', detail: makeBasicMarkdownString({ en: 'Listen to current sprite starting to be touched by sprite of given name (and get the sprite)', zh: '当前精灵与指定名字的精灵开始接触时执行(并获得精灵信息)' @@ -213,7 +213,8 @@ export const setCostume: DefinitionDocumentationItem = { kind: DefinitionKind.Command, definition: { package: packageSpx, - name: 'Sprite.setCostume' + name: 'Sprite.setCostume', + overloadId: '0' }, insertText: 'setCostume ${1:name}', overview: 'setCostume name', @@ -302,18 +303,51 @@ export const think1: DefinitionDocumentationItem = { }) } -export const distanceTo: DefinitionDocumentationItem = { +export const distanceTo0: DefinitionDocumentationItem = { + categories: [categories.sensing.distance], + kind: DefinitionKind.Read, + definition: { + package: packageSpx, + name: 'Sprite.distanceTo', + overloadId: '0' + }, + insertText: 'distanceTo(${1:sprite})', + overview: 'distanceTo(sprite)', + detail: makeBasicMarkdownString({ + en: 'Get the distance from current sprite to given sprite', + zh: '获取当前精灵到指定精灵的距离' + }) +} + +export const distanceTo1: DefinitionDocumentationItem = { categories: [categories.sensing.distance], kind: DefinitionKind.Read, definition: { package: packageSpx, - name: 'Sprite.distanceTo' + name: 'Sprite.distanceTo', + overloadId: '1' }, - insertText: 'distanceTo(${1:target})', - overview: 'distanceTo(target)', + insertText: 'distanceTo(${1:spriteName})', + overview: 'distanceTo(spriteName)', detail: makeBasicMarkdownString({ - en: 'Get the distance from current sprite to given target', - zh: '获取当前精灵到指定目标的距离' + en: 'Get the distance from current sprite to the sprite with given name, e.g., `distanceTo("Enemy")`', + zh: '获取当前精灵到指定名字的精灵的距离,如:`distanceTo("Enemy")`' + }) +} + +export const distanceTo2: DefinitionDocumentationItem = { + categories: [categories.sensing.distance], + kind: DefinitionKind.Read, + definition: { + package: packageSpx, + name: 'Sprite.distanceTo', + overloadId: '2' + }, + insertText: 'distanceTo(${1:obj})', + overview: 'distanceTo(obj)', + detail: makeBasicMarkdownString({ + en: 'Get the distance from current sprite to given object, e.g., `distanceTo(Mouse)`', + zh: '获取当前精灵到指定对象的距离,如:`distanceTo(Mouse)`' }) } @@ -337,7 +371,8 @@ export const step: DefinitionDocumentationItem = { kind: DefinitionKind.Command, definition: { package: packageSpx, - name: 'Sprite.step' + name: 'Sprite.step', + overloadId: '0' }, insertText: 'step ${1:distance}', overview: 'step distance', @@ -347,18 +382,51 @@ export const step: DefinitionDocumentationItem = { }) } -export const goto: DefinitionDocumentationItem = { +export const goto0: DefinitionDocumentationItem = { categories: [categories.motion.position], kind: DefinitionKind.Command, definition: { package: packageSpx, - name: 'Sprite.goto' + name: 'Sprite.goto', + overloadId: '0' }, - insertText: 'goto ${1:target}', - overview: 'goto target', + insertText: 'goto ${1:sprite}', + overview: 'goto sprite', detail: makeBasicMarkdownString({ - en: 'Move to given target', - zh: '移动到指定目标' + en: 'Move to given sprite', + zh: '移动到指定精灵' + }) +} + +export const goto1: DefinitionDocumentationItem = { + categories: [categories.motion.position], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.goto', + overloadId: '1' + }, + insertText: 'goto ${1:spriteName}', + overview: 'goto spriteName', + detail: makeBasicMarkdownString({ + en: 'Move to the sprite with given name, e.g., `goto "Enemy"`', + zh: '移动到指定名字的精灵,如:`goto "Enemy"`' + }) +} + +export const goto2: DefinitionDocumentationItem = { + categories: [categories.motion.position], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.goto', + overloadId: '2' + }, + insertText: 'goto ${1:obj}', + overview: 'goto obj', + detail: makeBasicMarkdownString({ + en: 'Move to given obj, e.g., `goto Mouse`', + zh: '移动到指定对象,如:`goto Mouse`' }) } @@ -373,7 +441,7 @@ export const glide0: DefinitionDocumentationItem = { insertText: 'glide ${1:x}, ${2:y}, ${3:seconds}', overview: 'glide x, y, seconds', detail: makeBasicMarkdownString({ - en: 'Move to given position (X, Y), with glide animation', + en: 'Move to given position (X, Y), using a glide animation', zh: '滑行到指定位置(X,Y)' }) } @@ -386,11 +454,43 @@ export const glide1: DefinitionDocumentationItem = { name: 'Sprite.glide', overloadId: '1' }, - insertText: 'glide(target Sprite, ${1:seconds})', - overview: 'glide target, seconds', + insertText: 'glide {$1:sprite}, ${2:seconds}', + overview: 'glide sprite, seconds', + detail: makeBasicMarkdownString({ + en: 'Move to given sprite, using a glide animation', + zh: '滑行到指定精灵' + }) +} + +export const glide2: DefinitionDocumentationItem = { + categories: [categories.motion.position], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.glide', + overloadId: '2' + }, + insertText: 'glide ${1:spriteName}, ${2:seconds}', + overview: 'glide spriteName, seconds', detail: makeBasicMarkdownString({ - en: 'Move to given target, with glide animation', - zh: '滑行到指定目标' + en: 'Move to the sprite with given name, using a glide animation', + zh: '滑行到指定名称的精灵' + }) +} + +export const glide3: DefinitionDocumentationItem = { + categories: [categories.motion.position], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.glide', + overloadId: '3' + }, + insertText: 'glide ${1:obj}, ${2:seconds}', + overview: 'glide obj, seconds', + detail: makeBasicMarkdownString({ + en: 'Move to given obj, using a glide animation, e.g., `glide Mouse, 2`', + zh: '滑行到指定对象,如:`glide Mouse, 2`' }) } @@ -544,22 +644,87 @@ export const heading: DefinitionDocumentationItem = { }) } -export const turn: DefinitionDocumentationItem = { +export const turn0: DefinitionDocumentationItem = { categories: [categories.motion.heading], kind: DefinitionKind.Command, definition: { package: packageSpx, - name: 'Sprite.turn' + name: 'Sprite.turn', + overloadId: '0' }, - insertText: 'turn ${1:dDirection}', - overview: 'turn dDirection', + insertText: 'turn ${1:degree}', + overview: 'turn degree', detail: makeBasicMarkdownString({ - en: 'Turn with given direction change, e.g., `turn Left`', - zh: '转动给定的角度,如:`turn Left`' + en: 'Turn with given degree, e.g., `turn 90`', + zh: '转动给定的角度,如:`turn 90`' + }) +} + +export const turn1: DefinitionDocumentationItem = { + categories: [categories.motion.heading], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.turn', + overloadId: '1' + }, + insertText: 'turn ${1:direction}', + overview: 'turn direction', + detail: makeBasicMarkdownString({ + en: 'Turn with given direction, e.g., `turn Left`', + zh: '朝给定的方向转动,如:`turn Left`' }) } export const turnTo0: DefinitionDocumentationItem = { + categories: [categories.motion.heading], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.turnTo', + overloadId: '0' + }, + insertText: 'turnTo ${1:sprite}', + overview: 'turnTo sprite', + detail: makeBasicMarkdownString({ + en: 'Turn heading to given sprite', + zh: '将朝向转到指定精灵' + }) +} + +export const turnTo1: DefinitionDocumentationItem = { + categories: [categories.motion.heading], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.turnTo', + overloadId: '1' + }, + insertText: 'turnTo ${1:spriteName}', + overview: 'turnTo spriteName', + detail: makeBasicMarkdownString({ + en: 'Turn heading to given sprite by name, e.g., `turnTo "Enemy"`', + zh: '将朝向转到指定名字的精灵,如:`turnTo "Enemy"`' + }) +} + +export const turnTo2: DefinitionDocumentationItem = { + categories: [categories.motion.heading], + kind: DefinitionKind.Command, + definition: { + package: packageSpx, + name: 'Sprite.turnTo', + overloadId: '2' + }, + insertText: 'turnTo ${1:degree}', + overview: 'turnTo degree', + detail: makeBasicMarkdownString({ + en: 'Turn heading to given degree, e.g., `turnTo 90`', + zh: '将朝向转到指定角度,如:`turnTo 90`' + }) +} + +export const turnTo3: DefinitionDocumentationItem = { categories: [categories.motion.heading], kind: DefinitionKind.Command, definition: { @@ -575,19 +740,19 @@ export const turnTo0: DefinitionDocumentationItem = { }) } -export const turnTo1: DefinitionDocumentationItem = { +export const turnTo4: DefinitionDocumentationItem = { categories: [categories.motion.heading], kind: DefinitionKind.Command, definition: { package: packageSpx, name: 'Sprite.turnTo', - overloadId: '1' + overloadId: '4' }, - insertText: 'turnTo ${1:target}', - overview: 'turnTo target', + insertText: 'turnTo ${1:obj}', + overview: 'turnTo obj', detail: makeBasicMarkdownString({ - en: 'Turn heading to given target', - zh: '将朝向转到指定目标' + en: 'Turn heading to given object, e.g., `turnTo Mouse`', + zh: '将朝向转到指定对象,如:`turnTo Mouse`' }) } @@ -666,18 +831,51 @@ export const changeSize: DefinitionDocumentationItem = { }) } -export const touching: DefinitionDocumentationItem = { +export const touching0: DefinitionDocumentationItem = { + categories: [categories.sensing.distance], + kind: DefinitionKind.Read, + definition: { + package: packageSpx, + name: 'Sprite.touching', + overloadId: '0' + }, + insertText: 'touching(${1:spriteName})', + overview: 'touching(spriteName)', + detail: makeBasicMarkdownString({ + en: 'Check if current sprite touching sprite with given name', + zh: '检查当前精灵是否与指定名字的精灵接触' + }) +} + +export const touching1: DefinitionDocumentationItem = { categories: [categories.sensing.distance], kind: DefinitionKind.Read, definition: { package: packageSpx, - name: 'Sprite.touching' + name: 'Sprite.touching', + overloadId: '1' }, - insertText: 'touching(${1:target})', - overview: 'touching(target)', + insertText: 'touching(${1:sprite})', + overview: 'touching(sprite)', detail: makeBasicMarkdownString({ - en: 'Check if current sprite touching specified target', - zh: '检查当前精灵是否与指定目标接触' + en: 'Check if current sprite touching given sprite', + zh: '检查当前精灵是否与指定精灵接触' + }) +} + +export const touching2: DefinitionDocumentationItem = { + categories: [categories.sensing.distance], + kind: DefinitionKind.Read, + definition: { + package: packageSpx, + name: 'Sprite.touching', + overloadId: '2' + }, + insertText: 'touching(${1:obj})', + overview: 'touching(obj)', + detail: makeBasicMarkdownString({ + en: 'Check if current sprite touching given object, e.g., `touching(Mouse)`', + zh: '检查当前精灵是否与指定对象接触,如:`touching(Mouse)`' }) } @@ -749,11 +947,11 @@ export const startBackdrop0: DefinitionDocumentationItem = { name: 'Game.startBackdrop', overloadId: '0' }, - insertText: 'startBackdrop ${1:backdrop}', - overview: 'startBackdrop backdrop', + insertText: 'startBackdrop ${1:backdropName}', + overview: 'startBackdrop backdropName', detail: makeBasicMarkdownString({ - en: 'Set the current backdrop by specifying name or index, e.g., `startBackdrop "backdrop1"`', - zh: '通过指定名称或索引切换背景,如:`startBackdrop "backdrop1"`' + en: 'Set the current backdrop by specifying name, e.g., `startBackdrop "backdrop1"`', + zh: '通过指定名称切换背景,如:`startBackdrop "backdrop1"`' }) } @@ -765,11 +963,11 @@ export const startBackdrop1: DefinitionDocumentationItem = { name: 'Game.startBackdrop', overloadId: '1' }, - insertText: 'startBackdrop ${1:backdrop}, ${2:wait}', - overview: 'startBackdrop backdrop, wait', + insertText: 'startBackdrop ${1:backdropName}, ${2:wait}', + overview: 'startBackdrop backdropName, wait', detail: makeBasicMarkdownString({ - en: 'Set the current backdrop by specifying name or index, with waiting, e.g., `startBackdrop "backdrop1", true`', - zh: '通过指定名称或索引切换背景,并等待切换完成,如:`startBackdrop "backdrop1", true`' + en: 'Set the current backdrop by specifying name, with waiting, e.g., `startBackdrop "backdrop1", true`', + zh: '通过指定名称切换背景,并等待切换完成,如:`startBackdrop "backdrop1", true`' }) } @@ -778,7 +976,8 @@ export const nextBackdrop: DefinitionDocumentationItem = { kind: DefinitionKind.Command, definition: { package: packageSpx, - name: 'Game.nextBackdrop' + name: 'Game.nextBackdrop', + overloadId: '0' }, insertText: 'nextBackdrop', overview: 'nextBackdrop', @@ -793,7 +992,8 @@ export const prevBackdrop: DefinitionDocumentationItem = { kind: DefinitionKind.Command, definition: { package: packageSpx, - name: 'Game.prevBackdrop' + name: 'Game.prevBackdrop', + overloadId: '0' }, insertText: 'prevBackdrop', overview: 'prevBackdrop', // TODO: optional argument `wait` diff --git a/spx-gui/src/components/editor/code-editor/lsp/index.ts b/spx-gui/src/components/editor/code-editor/lsp/index.ts index 487837fc8..0500a7d4e 100644 --- a/spx-gui/src/components/editor/code-editor/lsp/index.ts +++ b/spx-gui/src/components/editor/code-editor/lsp/index.ts @@ -112,4 +112,19 @@ export class SpxLSPClient extends Disposable { const spxlc = await this.prepareRquest() return spxlc.request(lsp.DocumentDiagnosticRequest.method, params) } + + async textDocumentHover(params: lsp.HoverParams): Promise { + const spxlc = await this.prepareRquest() + return spxlc.request(lsp.HoverRequest.method, params) + } + + async textDocumentDefinition(params: lsp.DefinitionParams): Promise { + const spxlc = await this.prepareRquest() + return spxlc.request(lsp.DefinitionRequest.method, params) + } + + async textDocumentTypeDefinition(params: lsp.TypeDefinitionParams): Promise { + const spxlc = await this.prepareRquest() + return spxlc.request(lsp.TypeDefinitionRequest.method, params) + } } diff --git a/spx-gui/src/components/editor/code-editor/ui/CodeEditorCard.vue b/spx-gui/src/components/editor/code-editor/ui/CodeEditorCard.vue index 6f9a22b41..03a3acf1f 100644 --- a/spx-gui/src/components/editor/code-editor/ui/CodeEditorCard.vue +++ b/spx-gui/src/components/editor/code-editor/ui/CodeEditorCard.vue @@ -1,7 +1,12 @@ - + @@ -10,6 +15,7 @@ .code-editor-card { border-radius: var(--ui-border-radius-1); background: var(--ui-color-grey-100); + border: 1px solid var(--ui-color-grey-400); // debug purpose, TODO: remove me box-shadow: 0px 16px 32px -12px rgba(14, 18, 27, 0.1); } diff --git a/spx-gui/src/components/editor/code-editor/ui/api-reference/APIReferenceItem.vue b/spx-gui/src/components/editor/code-editor/ui/api-reference/APIReferenceItem.vue index d3ef45a08..8555093ab 100644 --- a/spx-gui/src/components/editor/code-editor/ui/api-reference/APIReferenceItem.vue +++ b/spx-gui/src/components/editor/code-editor/ui/api-reference/APIReferenceItem.vue @@ -1,8 +1,8 @@ @@ -111,8 +106,4 @@ function handleWheel(e: WheelEvent) { scrollbar-width: thin; border-left: 1px solid var(--ui-color-dividing-line-2); } - -.detail-content { - font-size: 10px; -} diff --git a/spx-gui/src/components/editor/code-editor/ui/copilot/CopilotRound.vue b/spx-gui/src/components/editor/code-editor/ui/copilot/CopilotRound.vue index a6937c83e..082befbea 100644 --- a/spx-gui/src/components/editor/code-editor/ui/copilot/CopilotRound.vue +++ b/spx-gui/src/components/editor/code-editor/ui/copilot/CopilotRound.vue @@ -1,7 +1,7 @@ - - - - diff --git a/spx-gui/src/components/editor/code-editor/ui/copilot/UserMessage.vue b/spx-gui/src/components/editor/code-editor/ui/copilot/UserMessage.vue index b69dee98d..dcd5ee279 100644 --- a/spx-gui/src/components/editor/code-editor/ui/copilot/UserMessage.vue +++ b/spx-gui/src/components/editor/code-editor/ui/copilot/UserMessage.vue @@ -1,7 +1,7 @@ diff --git a/spx-gui/src/components/editor/code-editor/ui/markdown/DefinitionDetailWrapper.vue b/spx-gui/src/components/editor/code-editor/ui/definition/DefinitionDetailWrapper.vue similarity index 100% rename from spx-gui/src/components/editor/code-editor/ui/markdown/DefinitionDetailWrapper.vue rename to spx-gui/src/components/editor/code-editor/ui/definition/DefinitionDetailWrapper.vue diff --git a/spx-gui/src/components/editor/code-editor/ui/definition/DefinitionItem.vue b/spx-gui/src/components/editor/code-editor/ui/definition/DefinitionItem.vue new file mode 100644 index 000000000..401d56b69 --- /dev/null +++ b/spx-gui/src/components/editor/code-editor/ui/definition/DefinitionItem.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/spx-gui/src/components/editor/code-editor/ui/markdown/DefinitionOverviewWrapper.vue b/spx-gui/src/components/editor/code-editor/ui/definition/DefinitionOverviewWrapper.vue similarity index 60% rename from spx-gui/src/components/editor/code-editor/ui/markdown/DefinitionOverviewWrapper.vue rename to spx-gui/src/components/editor/code-editor/ui/definition/DefinitionOverviewWrapper.vue index acfc53c6d..13d254dd2 100644 --- a/spx-gui/src/components/editor/code-editor/ui/markdown/DefinitionOverviewWrapper.vue +++ b/spx-gui/src/components/editor/code-editor/ui/definition/DefinitionOverviewWrapper.vue @@ -1,15 +1,18 @@