visual-studio-codemonaco-editorvisual-studio-monaco

VS Code / Monaco - two questions for anyone familiar with the codebase


There are two capabilities I'm interested in expanding upon if I can get off to a quick start, but currently don't have time to deeply explore the codebase to figure out its intricacies (beyond some initial exploration I've already done), so I'm hoping someone familiar with the codebase of the VS Code editor can answer the following questions to save some time:

  1. Line wrapping in Markdown is currently ugly when the line starts with a bullet point, because the line wraps to the column containing the bullet character, rather than the column containing the first non-whitespace character following the bullet. Where in the codebase is line wrapping behaviour implemented? I wanted to tinker with this but had difficulty locating the logic that implements the actual line-wrapping itself, as opposed to configuration thereof.

  2. The editor implements synchronised scrolling for diff comparison; is this implemented in a way that could be generalised to any two editors, or is it highly specific to diffing? I'd like to investigate the possibility of a separate annotation/comment editor that is synchronised with the code being edited; effectively coding with multiple columns, which would require two editors operating in tandem.

Note: if this question is not a good fit for StackOverflow, given that "questions" are not permitted on the VS Code issues list, please advise me as to where it should be posted (somewhere that has enough traffic that it has a decent chance of actually getting a useful reply)


Solution

    1. This sort of wrapping was discussed in this issue. A follow up would be this api feature request. Currently not possible to implement

    2. Scroll sync is implemented by the markdown extension using the onDidChangeTextEditorVisibleRanges event from the VS Code API. An extension can attempt to synchronize any two editors using this event