From 7f6ccf3f5e4fdfbdd058a18b9768de73e7ec44a3 Mon Sep 17 00:00:00 2001 From: wuxinyi Date: Wed, 11 Feb 2026 10:54:38 +0800 Subject: [PATCH 1/2] feat(lsp): add xgoGetProperties command for lsp --- .../editor/code-editor/lsp/index.ts | 13 +++++++++++- .../editor/code-editor/lsp/spxls/commands.ts | 21 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) 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 a3b3b2146..57c871b18 100644 --- a/spx-gui/src/components/editor/code-editor/lsp/index.ts +++ b/spx-gui/src/components/editor/code-editor/lsp/index.ts @@ -18,7 +18,7 @@ import { } from '../common' import { XGoLanguageClient, type IConnection, ResponseError } from './spxls/client' import type { Files as SpxlsFiles, RequestMessage, ResponseMessage, NotificationMessage } from './spxls' -import { xgoGetInputSlots, xgoRenameResources } from './spxls/commands' +import { xgoGetInputSlots, xgoGetProperties, xgoRenameResources } from './spxls/commands' import { type CompletionItem, isDocumentLinkForResourceReference, @@ -254,6 +254,17 @@ export class SpxLSPClient extends Disposable { ) } + async workspaceExecuteCommandXGoGetProperty( + ctx: RequestContext, + ...params: xgoGetProperties.Arguments + ): Promise { + return this.executeCommand( + ctx, + xgoGetProperties.command, + ...params + ) + } + async textDocumentDocumentLink( ctx: RequestContext, params: lsp.DocumentLinkParams diff --git a/spx-gui/src/components/editor/code-editor/lsp/spxls/commands.ts b/spx-gui/src/components/editor/code-editor/lsp/spxls/commands.ts index 94b5da673..c622425ed 100644 --- a/spx-gui/src/components/editor/code-editor/lsp/spxls/commands.ts +++ b/spx-gui/src/components/editor/code-editor/lsp/spxls/commands.ts @@ -30,3 +30,24 @@ export namespace xgoGetInputSlots { } export type Result = XGoInputSlot[] | null } + +export namespace xgoGetProperties { + export const command = 'xgo.getProperties' + type XGoGetPropertiesParams = { + /** The target name, for example `Game` or a specific sprite name. */ + target: string + } + export type Arguments = [XGoGetPropertiesParams] + /** A property of a target type. */ + export type XGoProperty = { + /** The property name. */ + name: string + /** The property type as a string. */ + type: string + /** The kind of property. */ + kind: 'field' | 'method' + /** Optional documentation for the property. */ + doc?: string + } + export type Result = XGoProperty[] +} From fcaa62258400b5872034b752e1190b17652c39e1 Mon Sep 17 00:00:00 2001 From: wuxinyi Date: Wed, 11 Feb 2026 10:55:50 +0800 Subject: [PATCH 2/2] change workspaceExecuteCommandXGoGetProperty to workspaceExecuteCommandXGoGetProperties --- spx-gui/src/components/editor/code-editor/lsp/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 57c871b18..656367a71 100644 --- a/spx-gui/src/components/editor/code-editor/lsp/index.ts +++ b/spx-gui/src/components/editor/code-editor/lsp/index.ts @@ -254,7 +254,7 @@ export class SpxLSPClient extends Disposable { ) } - async workspaceExecuteCommandXGoGetProperty( + async workspaceExecuteCommandXGoGetProperties( ctx: RequestContext, ...params: xgoGetProperties.Arguments ): Promise {