Skip to content

Commit

Permalink
Merge branch '26-generate-code' into 35-add-builtin-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-senger committed Oct 30, 2024
2 parents ef91795 + a99fa1a commit 67c2516
Show file tree
Hide file tree
Showing 22 changed files with 2,785 additions and 19 deletions.
3 changes: 3 additions & 0 deletions packages/ttsl-lang/src/language/communication/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const COMMAND_PRINT_VALUE = 'ttsl.printValue';
export const COMMAND_RUN_PIPELINE = 'ttsl.runPipeline';
export const COMMAND_SHOW_IMAGE = 'ttsl.showImage';
59 changes: 59 additions & 0 deletions packages/ttsl-lang/src/language/communication/rpc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { MessageDirection, NotificationType0, RequestType0 } from 'vscode-languageserver';
import { NotificationType } from 'vscode-languageserver-protocol';

export namespace InstallRunnerNotification {
export const method = 'runner/install' as const;
export const messageDirection = MessageDirection.serverToClient;
export const type = new NotificationType0(method);
}

export namespace StartRunnerNotification {
export const method = 'runner/start' as const;
export const messageDirection = MessageDirection.clientToServer;
export const type = new NotificationType0(method);
}

export namespace RunnerStartedNotification {
export const method = 'runner/started' as const;
export const messageDirection = MessageDirection.serverToClient;
export const type = new NotificationType<RunnerStartedParams>(method);
}

export interface RunnerStartedParams {
/**
* The port the runner is listening on.
*/
port: number;
}

export namespace UpdateRunnerNotification {
export const method = 'runner/update' as const;
export const messageDirection = MessageDirection.serverToClient;
export const type = new NotificationType0(method);
}

export namespace ShowImageNotification {
export const method = 'runner/showImage' as const;
export const messageDirection = MessageDirection.serverToClient;
export const type = new NotificationType<ShowImageParams>(method);
}

export interface ShowImageParams {
image: {
/**
* The format of the image.
*/
format: 'png';

/**
* The Base64-encoded image.
*/
bytes: string;
};
}

export namespace IsRunnerReadyRequest {
export const method = 'runner/isReady' as const;
export const messageDirection = MessageDirection.clientToServer;
export const type = new RequestType0(method);
}
Loading

0 comments on commit 67c2516

Please sign in to comment.