-
Notifications
You must be signed in to change notification settings - Fork 44
overview documentation of the extension #857
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
base: main
Are you sure you want to change the base?
Conversation
| createPreviewPanel: ( | ||
| viewType: string, | ||
| title: string, | ||
| preserveFocus?: boolean, | ||
| options?: WebviewPanelOptions & WebviewOptions | ||
| ): WebviewPanel => { | ||
| return window.createWebviewPanel(viewType, title, { viewColumn: ViewColumn.Beside, preserveFocus, }, options); | ||
| } |
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.
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); |
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.
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.
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).