-
Notifications
You must be signed in to change notification settings - Fork 254
Extended reader proposal #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR lays the groundwork for an extended POML reader by introducing new reader subclasses, a segment interface with a stubbed segmentation function, and a detailed design proposal document.
- Add scaffolding for PureTextReader, PomlReader, MetaReader, and DispatchReader classes
- Define a
Segmentinterface and stub outcreateSegments - Include an extended POML format design spec and update VSCode settings
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/poml/reader/text.tsx | Adds PureTextReader subclass of Reader |
| packages/poml/reader/segment.ts | Defines Segment interface and unimplemented createSegments |
| packages/poml/reader/poml.tsx | Adds PomlReader subclass of Reader |
| packages/poml/reader/meta.ts | Adds MetaReader subclass (missing export) |
| packages/poml/reader/index.tsx | Adds DispatchReader subclass (missing export) |
| packages/poml/reader/base.tsx | Introduces base Reader class with abstract methods |
| docs/proposals/poml_extended.md | New design spec for extended POML file format |
| .vscode/settings.json | Adds typescriptreact editor tab size setting |
Comments suppressed due to low confidence (3)
packages/poml/reader/segment.ts:20
- The
createSegmentsfunction is currently unimplemented and will throw an error at runtime. Provide an implementation or at least add a TODO and corresponding tests to cover this behavior.
throw new Error('createSegments is not implemented yet');
packages/poml/reader/meta.ts:3
- The
MetaReaderclass is not exported, so it cannot be imported elsewhere. Addexportbefore the class declaration.
class MetaReader extends Reader {
packages/poml/reader/index.tsx:3
- The
DispatchReaderclass is not exported, preventing external usage. Addexportbefore the class declaration.
class DispatchReader extends Reader {
| @@ -0,0 +1,4 @@ | |||
| import { Reader } from './base'; | |||
|
|
|||
| export class PureTextReader extends Reader { | |||
Copilot
AI
Jul 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The PureTextReader class is empty and doesn’t override required methods. Implement or stub out react, getHoverToken, and getCompletions to clarify intended behavior.
| export class PureTextReader extends Reader { | |
| export class PureTextReader extends Reader { | |
| /** | |
| * React to changes or events. | |
| * Placeholder method. Requires implementation. | |
| */ | |
| react(event: any): void { | |
| // TODO: Implement the react method | |
| console.log("React method called with event:", event); | |
| } | |
| /** | |
| * Get the token to display on hover. | |
| * Placeholder method. Requires implementation. | |
| */ | |
| getHoverToken(position: any): string | null { | |
| // TODO: Implement the getHoverToken method | |
| console.log("getHoverToken method called with position:", position); | |
| return null; | |
| } | |
| /** | |
| * Get completion suggestions. | |
| * Placeholder method. Requires implementation. | |
| */ | |
| getCompletions(context: any): string[] { | |
| // TODO: Implement the getCompletions method | |
| console.log("getCompletions method called with context:", context); | |
| return []; | |
| } |
|
|
||
| ### File-level Metadata | ||
|
|
||
| Metadatas are information that is useful when parsing and rendering the file, such as context variables, stylesheets, version information, file paths, etc. |
Copilot
AI
Jul 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use “Metadata” (uncountable) instead of “Metadatas”. Consider revising to “Metadata is information that is useful…”.
| Metadatas are information that is useful when parsing and rendering the file, such as context variables, stylesheets, version information, file paths, etc. | |
| Metadata is information that is useful when parsing and rendering the file, such as context variables, stylesheets, version information, file paths, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Reader Class Mismatches Interface Methods
The Reader class implementation in packages/poml/reader/base.tsx does not align with the Reader interface defined in the docs/proposals/poml_extended.md design document. Specifically:
- The documented
read(segment: Segment, context: PomlContext?)method is implemented asreact(context?: PomlContext), with thesegmentparameter being passed to theReader's constructor instead of the method. - The documented
getHoverToken(segment: Segment, offset: number)method is implemented asgetHoverToken(offset: number), missing thesegmentparameter.
packages/poml/reader/base.tsx#L28-L35
poml/packages/poml/reader/base.tsx
Lines 28 to 35 in b28c535
| public react(context?: PomlContext): React.ReactElement { | |
| throw new Error('Method react() not implemented'); | |
| } | |
| public getHoverToken(offset: number): PomlToken | undefined { | |
| throw new Error('Method getHoverToken() not implemented'); | |
| } |
docs/proposals/poml_extended.md#L184-L189
poml/docs/proposals/poml_extended.md
Lines 184 to 189 in b28c535
| ```typescript | |
| interface Reader { | |
| read(segment: Segment, context: PomlContext?): React.ReactElement; | |
| getHoverToken(segment: Segment, offset: number): PomlToken | undefined; | |
| getCompletions(offset: number): PomlToken[]; | |
| } |
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
No description provided.