-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add error marker when invalid main function #9489
base: main
Are you sure you want to change the base?
Add error marker when invalid main function #9489
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.
PR Summary
Added error marker functionality to validate serverless function exports in the code editor, with custom Monaco editor markers for visual feedback.
- Added
setMarkers
prop inCodeEditor.tsx
to support custom Monaco editor markers during validation - Added new utility
getWrongExportedFunctionMarkers.ts
to detect invalid 'main' function exports using regex patterns - Fixed issue with hardcoded
endLineNumber=1
in marker coordinates which could cause incorrect error highlighting - Implemented marker cleanup by setting empty markers array when validation passes
- Added model state management in
CodeEditor.tsx
to properly track and update markers
3 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-ui/src/input/code-editor/components/CodeEditor.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-ui/src/input/code-editor/components/CodeEditor.tsx
Outdated
Show resolved
Hide resolved
...rc/modules/workflow/workflow-steps/workflow-actions/utils/getWrongExportedFunctionMarkers.ts
Outdated
Show resolved
Hide resolved
...rc/modules/workflow/workflow-steps/workflow-actions/utils/getWrongExportedFunctionMarkers.ts
Show resolved
Hide resolved
...rc/modules/workflow/workflow-steps/workflow-actions/utils/getWrongExportedFunctionMarkers.ts
Outdated
Show resolved
Hide resolved
a5e555d
to
9c8606d
Compare
c2390f1
to
244cc78
Compare
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.
That's perfect! Thank you! I approve the PR. Maybe we can write a few tests for the getWrongExportedFunctionMarkers
function.
Before
After