Skip to content

Run spxls in Web Worker#1189

Merged
nighca merged 1 commit intogoplus:devfrom
nighca:issue-1187
Jun 25, 2025
Merged

Run spxls in Web Worker#1189
nighca merged 1 commit intogoplus:devfrom
nighca:issue-1187

Conversation

@nighca
Copy link
Collaborator

@nighca nighca commented Dec 31, 2024

close #1187.

@qiniu-prow
Copy link

qiniu-prow bot commented Dec 31, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • spx-gui/tsconfig.app.json: Language not supported
Comments suppressed due to low confidence (1)

tools/spxls/client.ts:8

  • The error message 'unknown message type' is unclear. It should be updated to 'Unknown message type received in handleMessage'.
throw new Error('unknown message type')

@nighca
Copy link
Collaborator Author

nighca commented Jun 19, 2025

Without cancellation

Macbook Air M4 https://goplus-builder.qiniu.io/project/nighca/zombie

textDocument/completion (1) took 492ms
textDocument/completion (2) took 659ms
textDocument/completion (3) took 672ms
textDocument/completion (4) took 588ms
textDocument/completion (5) took 807ms
textDocument/completion (6) took 824ms
textDocument/completion (7) took 712ms
textDocument/completion (8) took 743ms
textDocument/completion (9) took 896ms
textDocument/completion (10) took 889ms

With cancellation

Macbook Air M4 https://goplus-builder.qiniu.io/project/nighca/zombie

textDocument/completion (1) took 529ms
textDocument/completion (4) took 434ms
textDocument/completion (7) took 406ms
textDocument/completion (10) took 413ms

editorRef,
(editor, _, onCleanUp) => {
if (editor == null) return
editor.init()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里 editor.init() 内部实现多了 registerMCPTools() 后,依赖的项有点多了,还是用 watchEffect 的话会在不预期的时候触发 effect,对应地导致错误


// Import sentryTracesSampleRate from env.ts instead of defining it locally
function initSentry() {
if (process.env.NODE_ENV === 'development') return
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sentry 会把很多 event handler 包一层以便捕捉事件,影响排查效率,开发的时候关掉

throw err
}
)
// TODO: Catch errors on sending, and clear the pending request
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中间多了 connection 之后感知 sendMessage 的错误会麻烦很多,先不管(考虑我们目前事实上几乎不会遇到这样的错误)

@qiniu-ci
Copy link

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.

@nighca nighca merged commit fb8e4cf into goplus:dev Jun 25, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run LS in Web Worker

4 participants

Comments