Commit ecb1bba
authored
Refactor analysis to decouple I/O from core logic (#8426)
* Refactor analysis to decouple I/O from core logic
Splits `Commands.ml` into a pure layer that returns OCaml values
(option, list, typed records like Protocol.hover,
Protocol.signatureHelp, Protocol.completionItem) and a new
`analysis/src/Cli.ml` that does the stringify-and-print step.
`analysis/bin/main.ml` now dispatches to `Cli.*`, while the LSP server
consumes `Commands.*` directly.
Makes the parsers accept source strings: `res_driver` gains
`parse_interface_from_source` alongside the existing
`parse_implementation_from_source`
* Rename `tokenModifiersString` to `tokenModifiers` with correct type
* update CHANGELOG.md
* Fix format range to use accurate line/character positions
The previous implementation used the source byte length as both line and
character values for the end of the format range, which was incorrect.
Replace it with a helper that computes the actual final line index and
character offset by splitting on newlines.
Signed-Off-By: Your Name <email>
* Refactor token debugger to use typed input variant
---------
Signed-off-by: Your Name <email>1 parent de28ae6 commit ecb1bba
20 files changed
Lines changed: 819 additions & 529 deletions
File tree
- analysis
- bin
- src
- compiler/syntax/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 143 | + | |
146 | 144 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 145 | + | |
150 | 146 | | |
151 | 147 | | |
152 | | - | |
| 148 | + | |
153 | 149 | | |
154 | 150 | | |
155 | 151 | | |
| |||
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
162 | | - | |
| 158 | + | |
163 | 159 | | |
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
167 | 163 | | |
168 | 164 | | |
169 | 165 | | |
170 | | - | |
| 166 | + | |
171 | 167 | | |
172 | 168 | | |
173 | | - | |
| 169 | + | |
174 | 170 | | |
175 | 171 | | |
176 | | - | |
| 172 | + | |
177 | 173 | | |
178 | 174 | | |
179 | 175 | | |
| |||
183 | 179 | | |
184 | 180 | | |
185 | 181 | | |
| 182 | + | |
186 | 183 | | |
187 | | - | |
| 184 | + | |
188 | 185 | | |
189 | 186 | | |
190 | 187 | | |
191 | 188 | | |
192 | 189 | | |
193 | | - | |
| 190 | + | |
194 | 191 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 192 | + | |
198 | 193 | | |
199 | | - | |
200 | | - | |
201 | | - | |
| 194 | + | |
202 | 195 | | |
203 | | - | |
| 196 | + | |
204 | 197 | | |
205 | 198 | | |
206 | | - | |
207 | | - | |
| 199 | + | |
208 | 200 | | |
209 | 201 | | |
210 | 202 | | |
211 | | - | |
212 | | - | |
213 | | - | |
| 203 | + | |
| 204 | + | |
214 | 205 | | |
215 | 206 | | |
216 | 207 | | |
| |||
0 commit comments