-
Notifications
You must be signed in to change notification settings - Fork 33
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
Exception handling in code editor #1196
Conversation
nighca
commented
Jan 6, 2025
•
edited
Loading
edited
- Exception handling in code editor, close Exception handling in code editor #1134
- Debug project-switching in editor
Skipping CI for Draft Pull Request. |
// Case 4: Different user: Discard local cache | ||
await clear(LOCAL_CACHE_KEY) | ||
localProject = null | ||
} | ||
|
||
if (localProject?.hasUnsyncedChanges) { | ||
if (!projectName) { | ||
if (await askToOpenCachedVersionForCurrent(localProject.name!)) { |
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.
askToOpenCachedVersionForCurrent
的逻辑已经事实上没生效了,因为目前进入 editor 一定会带上 projectName
(router 那里保证了),所以 loadProject
中并不会走到这里
这里先把失效代码删掉,单独记了个 issue 后续再 review 一下这里的逻辑
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.
Copilot reviewed 11 out of 26 changed files in this pull request and generated no comments.
Files not reviewed (15)
- spx-gui/src/components/editor/code-editor/ui/context-menu/ContextMenu.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/hover/HoverCard.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/CodeEditorUI.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/MonacoEditor.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/api-reference/APIReferenceItem.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/api-reference/APIReferenceUI.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/completion/CompletionUI.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/CodeLink.vue: Evaluated as low risk
- spx-gui/src/pages/editor/index.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/resource-reference/selector/ResourceSelector.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/hover/HoverUI.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/context-menu/ContextMenuUI.vue: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/diagnostics/index.ts: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/context-menu/index.ts: Evaluated as low risk
- spx-gui/src/components/editor/code-editor/ui/code-editor-ui.ts: Evaluated as low risk
Comments suppressed due to low confidence (5)
spx-gui/src/components/editor/code-editor/ui/api-reference/index.ts:41
- [nitpick] Ensure that the error messages returned by itemsMgr.result.error are clear and helpful.
return this.itemsMgr.result.error
spx-gui/src/components/editor/code-editor/ui/completion/index.ts:100
- Reset filterPositionRef when stopping the completion to avoid stale positions.
this.completionMgr.stop()
spx-gui/src/components/editor/code-editor/ui/completion/index.ts:70
- completionError is introduced but not used anywhere. Ensure it is used appropriately to handle errors during the completion process.
return this.completionMgr.result.error
spx-gui/src/components/editor/code-editor/context.ts:2
- The error message 'Monaco not initialized' could be more descriptive. Consider changing it to 'Monaco instance is not initialized. Please ensure that the Monaco editor is properly set up before calling getMonaco.'
if (monacoRef.value == null) throw new Error('Monaco not initialized')
spx-gui/src/components/editor/code-editor/ui/resource-reference/index.ts:37
- Add error handling to ensure that any issues with fetching resource references are logged or communicated to the user.
const items = await provider.provideResourceReferences({ textDocument, signal })
有个 conflict 要解决下 |
噢好的 |
This PR has been deployed to the preview environment. You can explore it using the preview URL. Warning Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the Go+ Builder team. |