Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion spx-gui/src/components/editor/code-editor/lsp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -254,6 +254,17 @@ export class SpxLSPClient extends Disposable {
)
}

async workspaceExecuteCommandXGoGetProperties(
ctx: RequestContext,
...params: xgoGetProperties.Arguments
): Promise<xgoGetProperties.Result> {
return this.executeCommand<xgoGetProperties.Arguments, xgoGetProperties.Result>(
ctx,
xgoGetProperties.command,
...params
)
}

async textDocumentDocumentLink(
ctx: RequestContext,
params: lsp.DocumentLinkParams
Expand Down
21 changes: 21 additions & 0 deletions spx-gui/src/components/editor/code-editor/lsp/spxls/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
nighca marked this conversation as resolved.
}
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
Comment thread
nighca marked this conversation as resolved.
/** The kind of property. */
kind: 'field' | 'method'
/** Optional documentation for the property. */
doc?: string
}
export type Result = XGoProperty[]
Comment thread
nighca marked this conversation as resolved.
Comment thread
nighca marked this conversation as resolved.
}
Comment thread
nighca marked this conversation as resolved.