feat(pbs): add sprite animation and shared Studio authoring
Implement DEC-0084 with factory-only Sprite/Animator structs, complete result lowering, validated animation sidecars, generated PBS factories and JavaFX/MCP authoring through shared services. Qualify native dev/release with ordinary and optimized producers, zero-allocation playback, private-cycle reclamation, canonical Composer pixels, installed JARs and JavaFX lifecycle. Preserve the runtime checkout and existing host ABI.
This commit is contained in:
@@ -52,7 +52,16 @@ function activate(context) {
|
||||
reconnectContext = context;
|
||||
output = vscode.window.createOutputChannel("Prometeu LSP");
|
||||
output.appendLine("Prometeu VS Code extension activated.");
|
||||
context.subscriptions.push(externalSources, vscode.workspace.registerTextDocumentContentProvider(externalSources_1.externalScheme, externalSources), vscode.window.onDidChangeActiveTextEditor(() => externalSources.refreshStatus()), vscode.workspace.onDidOpenTextDocument(document => void externalSources.opened(document)), vscode.workspace.onDidCloseTextDocument(document => void externalSources.closeDocument(document)));
|
||||
context.subscriptions.push(externalSources, vscode.languages.registerCodeLensProvider({ scheme: externalSources_1.externalScheme, language: "pbs" }, {
|
||||
provideCodeLenses: document => externalSources.originLenses(document)
|
||||
}), vscode.commands.registerCommand("prometeu.openAnimationOrigin", async (uri, byteOffset) => {
|
||||
try {
|
||||
await externalSources.openAnimationOrigin(uri, byteOffset);
|
||||
}
|
||||
catch (error) {
|
||||
void vscode.window.showErrorMessage(String(error));
|
||||
}
|
||||
}), vscode.workspace.registerTextDocumentContentProvider(externalSources_1.externalScheme, externalSources), vscode.window.onDidChangeActiveTextEditor(() => externalSources.refreshStatus()), vscode.workspace.onDidOpenTextDocument(document => void externalSources.opened(document)), vscode.workspace.onDidCloseTextDocument(document => void externalSources.closeDocument(document)));
|
||||
const connectCommand = vscode.commands.registerCommand("prometeu.connectStudioLsp", async () => {
|
||||
await startClient(context);
|
||||
});
|
||||
|
||||
@@ -108,6 +108,25 @@ class ExternalSources {
|
||||
this.refreshStatus();
|
||||
return content.text;
|
||||
}
|
||||
originLenses(document) {
|
||||
if (!this.canQuery(document))
|
||||
return [];
|
||||
const content = this.documents.get(document.uri.toString());
|
||||
return (content?.descriptor.origins ?? []).map(origin => {
|
||||
const offset = Buffer.from(document.getText(), "utf8").subarray(0, origin.startOffset).toString("utf8").length;
|
||||
const position = document.positionAt(offset);
|
||||
return new vscode.CodeLens(new vscode.Range(position, position), {
|
||||
title: "Open animation definition in Studio", command: "prometeu.openAnimationOrigin",
|
||||
arguments: [document.uri, origin.startOffset]
|
||||
});
|
||||
});
|
||||
}
|
||||
async openAnimationOrigin(uri, byteOffset) {
|
||||
const document = vscode.workspace.textDocuments.find(doc => doc.uri.toString() === uri.toString());
|
||||
if (!document || !this.canQuery(document) || !this.client || !this.consumerId)
|
||||
throw new Error("Animation source unavailable: navigate again to obtain the current revision.");
|
||||
await this.client.sendRequest("prometeu/openAnimationOrigin", { consumerId: this.consumerId, uri: uri.toString(), offset: byteOffset });
|
||||
}
|
||||
async opened(document) {
|
||||
if (document.uri.scheme !== exports.externalScheme)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user