Skip to content

Conversation

@vezwork
Copy link
Collaborator

@vezwork vezwork commented Oct 22, 2025

Here are some added inline docs, minor refactors, and a large overview markdown file that links to various key places in the code and gives some examples of how parts of the extension communicate with eachother. The inline docs and minor refactors mostly aim to address places I have been getting stuck/lost repeatedly while navigating code over the past few months.

I did this to help me get re-oriented, and to be able to answer questions about how to architect #825 and future features that involve "piping things through" (sharing functionality between the Source Editor and Visual Editor by communicating from the Visual Editor to the host and LSP in a consistent way).

@vezwork vezwork requested review from cscheid and juliasilge October 24, 2025 21:51
@vezwork vezwork changed the title WIP documentation of how VE communicates with HOST and LSP overview documentation of the extension Oct 24, 2025
Comment on lines +125 to +132
createPreviewPanel: (
viewType: string,
title: string,
preserveFocus?: boolean,
options?: WebviewPanelOptions & WebviewOptions
): WebviewPanel => {
return window.createWebviewPanel(viewType, title, { viewColumn: ViewColumn.Beside, preserveFocus, }, options);
}
Copy link
Collaborator Author

@vezwork vezwork Oct 24, 2025

Choose a reason for hiding this comment

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

This was previously imported from preview.ts where it was defined by itself. I found that hard to navigate and also the implementation of this function in the other ExtensionHost in hooks.ts defines this inline.

private async hasExecutorForLanguage(language: string, document: TextDocument, engine: MarkdownEngine) {
// TODO: this is incorrect right? `cellExecutorForLanguage` returns a promise, and a promise will always be truthy?
// We should have to await it before doing `!!`
return !!this.cellExecutorForLanguage(language, document, engine);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Didn't want to make a change here because it will change the logic, so I left a TODO so I don't forget the next time I'm working in this area.

@vezwork vezwork marked this pull request as ready for review October 24, 2025 22:00
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.

1 participant