Crystal-Modeling / tasklist-theia-glsp

Primitive demo project aiming to use tasklist-lang (Langium LS) as a SourceModel server for GLSP Server
6 stars 1 forks source link

Navigation sync for code & diagram elements #10

Open hpopov opened 1 year ago

hpopov commented 1 year ago

To mimic Sprotty Server behavior, add code elements navigation sync:

hpopov commented 1 year ago

Found existing in LSP (from 2020) LSP Client action to open a particular document with particular text range selected: Show Document Request ()

hpopov commented 1 year ago

Looked at Sprotty Server integration with XText-based LS demo to figure out, how exactly navigation sync is organized:

  1. Whenever code element is navigated (i.e., clicked) -- diagram element gets centered
  2. Whenever diagram element is selected -- code element is navigated, but diagram element itself is not centered! (since we are working with diagram at the moment)
hpopov commented 1 year ago

To listen to Code Editor cursor updates (LSP Client focus changed), I need to listen to connection.onDocumentHighlight on Langium LSP Server.

See documentation