Skip to content

Latest Capture contribution #107

Open
jspahn80134 wants to merge 12 commits intobjones1:mainfrom
jspahn80134:main
Open

Latest Capture contribution #107
jspahn80134 wants to merge 12 commits intobjones1:mainfrom
jspahn80134:main

Conversation

@jspahn80134
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Owner

@bjones1 bjones1 left a comment

Choose a reason for hiding this comment

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

When I tested the code, I got a series of errors in the JS console:

log.ts:460   ERR [Extension Host] Error sending capture event: TypeError: fetch failed
	at node:internal/deps/undici/undici:14902:13
	at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
	at async ZQ.globalThis.fetch (file:///c:/Program%20Files/Microsoft%20VS%20Code/41dd792b5e/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:632:23860)
	at async sendCaptureEvent (c:\Users\bj147\Documents\git\CodeChat_Editor\extensions\VSCode\out\extension.js:768:18)
error @ log.ts:460
error @ log.ts:565
error @ logService.ts:51
cio @ remoteConsoleUtil.ts:58
$logExtensionHostMessage @ mainThreadConsole.ts:38
_doInvokeHandler @ rpcProtocol.ts:458
_invokeHandler @ rpcProtocol.ts:443
_receiveRequest @ rpcProtocol.ts:373
_receiveOneMessage @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
_deliver @ event.ts:1354
fire @ event.ts:1385
fire @ ipc.net.ts:652
(anonymous) @ localProcessExtensionHost.ts:421
console.ts:139 [Extension Host] Error sending capture event: TypeError: fetch failed
	at node:internal/deps/undici/undici:14902:13
	at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
	at async ZQ.globalThis.fetch (file:///c:/Program%20Files/Microsoft%20VS%20Code/41dd792b5e/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:632:23860)
	at async sendCaptureEvent (c:\Users\bj147\Documents\git\CodeChat_Editor\extensions\VSCode\out\extension.js:768:18) (at console.<anonymous> (file:///c:/Program%20Files/Microsoft%20VS%20Code/41dd792b5e/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:632:33642))

I'd like to be able to see what logging events are sent. Here's my thoughts from reading the code:

  • As far as I can tell, any edits are examined by classifyAtPosition() by the VSCode extension. This only seems to distinguish between edits to documents (Markdown, reST, latex) and code. I don't see any way to separate out edits to code vs doc blocks; isInMarkdownCodeFence()
  • It looks like most of the intelligence in terms of code vs. doc blocks happens in the extension. This would make more sense in the server, since that already separates code and doc blocks. Also, I suspect that changes make in the CodeChat Editor may not come through very cleanly. Instead, inside processing::codechat_for_web_to_source and inside processing::source_to_codechat_for_web, you have access to a vec<CodeDocBlock> where parsing is done. There are also utils to diff this vec with another, if you wanted to store the results more compactly.
  • I'd suggest sending data capture messages to the server, which the DB can then act on/intercept. Setting up a side HTTP connection doesn't make sense given the existing connection. Instead, it should be easy to add either CaptureEvent or CaptureEventWire to webserver::EditorMessageContents as a Capture message type.
  • I see you're logging compiles, debug starts, saves, etc. Great!
  • Minor issues:
    • There are two copies of capture_config.json -- is only one in needed?

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.

2 participants