Commit 573ff14
authored
refactor(core): consolidate complete_package_names, seal Ecosystem, remove once_cell (#71)
* refactor(core): consolidate complete_package_names, seal Ecosystem, remove once_cell
Consolidate complete_package_names across Cargo, npm, PyPI, Bundler,
Dart ecosystems to use complete_package_names_generic from deps-core.
Rename ranges_overlap to position_in_range for semantic clarity.
Replace once_cell::sync::Lazy with std::sync::LazyLock, remove once_cell
dependency.
Seal Ecosystem trait with private::Sealed supertrait to prevent external
implementations.
Rename format_version_for_code_action to format_version_for_text_edit
to better reflect its TextEdit context.
Closes #68
* refactor(core): unify DependencySource enum across all ecosystems
Consolidate 4 duplicate DependencySource enums (Cargo, PyPI, Dart,
Bundler) into a single 7-variant enum in deps-core:
Registry, Git, Path, Url, Sdk, Workspace, CustomRegistry.
Eliminates lossy conversions at trait boundaries: PyPI Url and Dart Sdk
variants are now preserved through the Dependency trait. Cargo
workspace_inherited bool replaced by DependencySource::Workspace.
Add #[non_exhaustive] for forward compatibility. Add is_registry() and
is_version_resolvable() convenience methods. Simplify
UnifiedDependency::is_registry() to delegate to core enum.
Ref #681 parent a9ac193 commit 573ff14
File tree
38 files changed
+348
-577
lines changed- crates
- deps-bundler
- src
- deps-cargo
- src
- deps-core
- src
- deps-dart
- src
- deps-go
- src
- deps-gradle/src
- deps-lsp/src/document
- deps-maven/src
- deps-npm/src
- deps-pypi/src
38 files changed
+348
-577
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 38 | + | |
| 39 | + | |
63 | 40 | | |
64 | 41 | | |
65 | 42 | | |
| |||
73 | 50 | | |
74 | 51 | | |
75 | 52 | | |
| 53 | + | |
| 54 | + | |
76 | 55 | | |
77 | 56 | | |
78 | 57 | | |
| |||
201 | 180 | | |
202 | 181 | | |
203 | 182 | | |
204 | | - | |
205 | | - | |
| 183 | + | |
| 184 | + | |
206 | 185 | | |
207 | 186 | | |
208 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
236 | | - | |
| 234 | + | |
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
240 | 238 | | |
241 | | - | |
242 | | - | |
243 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
244 | 242 | | |
245 | 243 | | |
246 | 244 | | |
| |||
421 | 419 | | |
422 | 420 | | |
423 | 421 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 19 | + | |
41 | 20 | | |
42 | 21 | | |
43 | 22 | | |
| |||
106 | 85 | | |
107 | 86 | | |
108 | 87 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 88 | + | |
124 | 89 | | |
125 | 90 | | |
126 | 91 | | |
| |||
146 | 111 | | |
147 | 112 | | |
148 | 113 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 114 | + | |
164 | 115 | | |
165 | 116 | | |
166 | 117 | | |
| |||
195 | 146 | | |
196 | 147 | | |
197 | 148 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 149 | + | |
201 | 150 | | |
202 | 151 | | |
203 | 152 | | |
204 | 153 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 154 | + | |
211 | 155 | | |
212 | 156 | | |
213 | 157 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
219 | 162 | | |
220 | 163 | | |
221 | 164 | | |
| |||
311 | 254 | | |
312 | 255 | | |
313 | 256 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 257 | + | |
318 | 258 | | |
319 | 259 | | |
320 | 260 | | |
| |||
323 | 263 | | |
324 | 264 | | |
325 | 265 | | |
326 | | - | |
327 | | - | |
328 | | - | |
| 266 | + | |
329 | 267 | | |
330 | 268 | | |
331 | 269 | | |
| |||
353 | 291 | | |
354 | 292 | | |
355 | 293 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | 294 | | |
375 | 295 | | |
376 | 296 | | |
377 | 297 | | |
378 | | - | |
379 | | - | |
| 298 | + | |
380 | 299 | | |
381 | 300 | | |
382 | 301 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
| 302 | + | |
387 | 303 | | |
388 | 304 | | |
389 | 305 | | |
| |||
404 | 320 | | |
405 | 321 | | |
406 | 322 | | |
407 | | - | |
408 | | - | |
409 | | - | |
| 323 | + | |
410 | 324 | | |
411 | 325 | | |
412 | 326 | | |
413 | 327 | | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
| 328 | + | |
420 | 329 | | |
421 | 330 | | |
422 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
0 commit comments