Skip to content

Highlight Mermaid Syntax in Editor for Element when a Graph/Chart Element is Selected in the WebView #279

@udlose

Description

@udlose

It would be pretty cool to be able to select an element/object in a rendered Mermaid Diagram and have it automatically "correlate" the text in the TextEditor that represents the selected element/object. The correlated text would be selected/highlighted in the TextEditor.

This task will most likely touch:

  • Javascript in index.html
  • C# in MermaidRenderer to alert the app that something was selected in the WebView
  • C# in the Services/Editor area. Possibly create a new MermaidLexer that will be responsible for the pattern matching to break up the syntax into meaningful tokens. Possibly create a new MermaidParser that does semantic analysis and output ab Abstract Syntax Tree. I already have some classes that can provide some starting points for this work:
    • Services/Editor/CommentingStrategy
    • Services/Editor/DocumentAnalyzer
    • Services/Editor/MermaidIndentationStrategy
  • I suspect a good amount of refactoring of the existing code will be needed so it can be reused by these new classes - or maybe the new ones will supersede the existing ones?

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendCovers changes, bug fixes, and improvements to the backend implementation.enhancementNew feature or requestjavascriptPull requests that update javascript coderefactoringChanges related to refactoring existing functionalityuser interfaceCovers changes, bug fixes and improvements to the UI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions