Conversation
martin-fleck-at
left a comment
There was a problem hiding this comment.
Thank you @Sakrafux! I think we need to make some changes here but I believe some of the problems will go away once we properly implement eclipse-glsp/glsp#607 which I plan to tackle next, so we can leave that for now as is.
| return { | ||
| kind: KIND, | ||
| mcpRequestId, | ||
| ...options |
There was a problem hiding this comment.
Options are spread here into their nested fields but in the action interface they are declared in a single options field, this will not work as expected.
| kind: KIND, | ||
| mcpRequestId, | ||
| png, | ||
| ...options |
There was a problem hiding this comment.
Options are spread here into their nested fields but in the action interface they are declared in a single options field, this will not work as expected.
| import { inject, injectable } from 'inversify'; | ||
|
|
||
| @injectable() | ||
| export class GetSelectionMcpCommand extends Command { |
There was a problem hiding this comment.
I think this might need to be a SystemCommand so that we do not pollute the undo/redo stack.
| const ctx = offscreen.getContext('2d'); | ||
|
|
||
| if (!ctx) { | ||
| reject(new Error('Failed to get offscreen context.')); |
There was a problem hiding this comment.
We should make sure to call URL.revokeObjectURL(url) here as well.
| }; | ||
| reader.readAsDataURL(outBlob); | ||
| } catch (err) { | ||
| reject(err); |
There was a problem hiding this comment.
We should make sure to call URL.revokeObjectURL(url) here as well.
| mcpRequestId: string; | ||
| } | ||
| export namespace GetSelectionMcpAction { | ||
| export const KIND = 'GetSelectionMcpAction'; |
There was a problem hiding this comment.
In GLSP we typically use camelCase and not PascalCase for this sort of string. Also true for the others.
Extends the GLSP MCP Server started in PR-456 according to our meetings @martin-fleck-at.