File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,59 @@ We call a few binaries and it's tricky to call them properly cross-platform. Her
112112
113113## Rough Description Of How The Plugin Works
114114
115+ ### Text Changes
116+
117+ The flow below shows how the LSP server reacts to incremental text changes and produces diagnostics:
118+
119+ ``` mermaid
120+ flowchart TD
121+ A[Your ReScript file in your editor]
122+ B[LSP Client]
123+ C[LSP Server]
124+ D[bsc]
125+
126+ A -->|Type a character| B
127+ B -->|textDocument/didChange| C
128+
129+ subgraph LSP_Server_Internal_Flow["LSP Server"]
130+ C1[triggerIncrementalCompilationOfFile]
131+ C2[compileContents]
132+ C3[figureOutBscArgs]
133+ C4[parse .compiler.log]
134+ end
135+
136+ C --> C1
137+ C1 --> C2 --> C3
138+ C3 -->|invoke| D
139+ D -->|writes| C4
140+ C4 -->|textDocument/publishDiagnostics| B
141+ ```
142+
143+ ### Completion
144+
145+ The flow below shows how the LSP server handles completion requests by delegating to the native analysis binary:
146+
147+ ``` mermaid
148+ flowchart TD
149+ A[Your ReScript file in your editor]
150+ B[LSP Client]
151+ C[LSP Server]
152+ D[rescript-editor-analysis.exe]
153+
154+ A -->|Trigger completion| B
155+ B -->|textDocument/completion| C
156+
157+ subgraph LSP_Server_Internal_Flow["LSP Server"]
158+ C1[shell out to rescript-editor-analysis.exe]
159+ C2[build completion response]
160+ end
161+
162+ C --> C1
163+ C1 -->|exec| D
164+ D --> C2
165+ C2 -->|textDocument/completion response| B
166+ ```
167+
115168### Editor Diagnostics
116169
117170They should be synced in from ` lib/bs/.compiler.log ` build. Don't take them from other places.
You can’t perform that action at this time.
0 commit comments