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..656367a71 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 workspaceExecuteCommandXGoGetProperties( + 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[] +}