@birdcc/lsp 0.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.oxfmtrc.json +16 -0
  2. package/LICENSE +674 -0
  3. package/README.md +343 -0
  4. package/dist/completion.d.ts +8 -0
  5. package/dist/completion.d.ts.map +1 -0
  6. package/dist/completion.js +137 -0
  7. package/dist/completion.js.map +1 -0
  8. package/dist/definition.d.ts +5 -0
  9. package/dist/definition.d.ts.map +1 -0
  10. package/dist/definition.js +21 -0
  11. package/dist/definition.js.map +1 -0
  12. package/dist/diagnostic.d.ts +6 -0
  13. package/dist/diagnostic.d.ts.map +1 -0
  14. package/dist/diagnostic.js +38 -0
  15. package/dist/diagnostic.js.map +1 -0
  16. package/dist/document-symbol.d.ts +4 -0
  17. package/dist/document-symbol.d.ts.map +1 -0
  18. package/dist/document-symbol.js +20 -0
  19. package/dist/document-symbol.js.map +1 -0
  20. package/dist/hover-docs.d.ts +5 -0
  21. package/dist/hover-docs.d.ts.map +1 -0
  22. package/dist/hover-docs.js +141 -0
  23. package/dist/hover-docs.js.map +1 -0
  24. package/dist/hover-docs.yaml +600 -0
  25. package/dist/hover.d.ts +5 -0
  26. package/dist/hover.d.ts.map +1 -0
  27. package/dist/hover.js +81 -0
  28. package/dist/hover.js.map +1 -0
  29. package/dist/index.d.ts +9 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +8 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/lsp-server.d.ts +3 -0
  34. package/dist/lsp-server.d.ts.map +1 -0
  35. package/dist/lsp-server.js +250 -0
  36. package/dist/lsp-server.js.map +1 -0
  37. package/dist/references.d.ts +5 -0
  38. package/dist/references.d.ts.map +1 -0
  39. package/dist/references.js +48 -0
  40. package/dist/references.js.map +1 -0
  41. package/dist/server.d.ts +3 -0
  42. package/dist/server.d.ts.map +1 -0
  43. package/dist/server.js +4 -0
  44. package/dist/server.js.map +1 -0
  45. package/dist/shared.d.ts +17 -0
  46. package/dist/shared.d.ts.map +1 -0
  47. package/dist/shared.js +150 -0
  48. package/dist/shared.js.map +1 -0
  49. package/dist/symbol-utils.d.ts +17 -0
  50. package/dist/symbol-utils.d.ts.map +1 -0
  51. package/dist/symbol-utils.js +84 -0
  52. package/dist/symbol-utils.js.map +1 -0
  53. package/dist/validation.d.ts +21 -0
  54. package/dist/validation.d.ts.map +1 -0
  55. package/dist/validation.js +47 -0
  56. package/dist/validation.js.map +1 -0
  57. package/package.json +45 -0
  58. package/scripts/copy-hover-yaml.mjs +14 -0
  59. package/src/completion.ts +223 -0
  60. package/src/definition.ts +50 -0
  61. package/src/diagnostic.ts +48 -0
  62. package/src/document-symbol.ts +27 -0
  63. package/src/hover-docs.ts +223 -0
  64. package/src/hover-docs.yaml +600 -0
  65. package/src/hover.ts +122 -0
  66. package/src/index.ts +8 -0
  67. package/src/lsp-server.ts +350 -0
  68. package/src/references.ts +107 -0
  69. package/src/server.ts +4 -0
  70. package/src/shared.ts +182 -0
  71. package/src/symbol-utils.ts +126 -0
  72. package/src/validation.ts +85 -0
  73. package/test/hover-docs.test.ts +18 -0
  74. package/test/lsp.test.ts +304 -0
  75. package/test/perf-baseline.test.ts +96 -0
  76. package/test/validation.test.ts +212 -0
  77. package/tsconfig.json +8 -0
@@ -0,0 +1,600 @@
1
+ version: 1
2
+ baseUrls:
3
+ v2: https://bird.nic.cz/doc/bird-2.18.html
4
+ v3: https://bird.nic.cz/doc/bird-3.2.0.html
5
+ entries:
6
+ - keyword: .asn
7
+ description: Extract AS number from pair
8
+ detail: Get the AS number component from an AS path pair.
9
+ diff: same
10
+ version: v2+
11
+ anchor: filter-pair
12
+ - keyword: .data
13
+ description: Extract data from pair
14
+ detail: Get the data component from an AS path pair.
15
+ diff: same
16
+ version: v2+
17
+ anchor: filter-pair
18
+ - keyword: .ip
19
+ description: Extract IP from prefix
20
+ detail: Get the network address part of a prefix.
21
+ diff: same
22
+ version: v2+
23
+ anchor: filter-prefix
24
+ - keyword: .len
25
+ description: Prefix length operator
26
+ detail: Get the prefix length of a prefix value.
27
+ diff: same
28
+ version: v2+
29
+ anchor: filter-prefix
30
+ - keyword: .mask
31
+ description: IP mask operator
32
+ detail: Get the subnet mask as an IP address.
33
+ diff: same
34
+ version: v2+
35
+ anchor: filter-ip
36
+ - keyword: accept
37
+ description: Accept route
38
+ detail: Accept the current route and stop processing the filter.
39
+ diff: same
40
+ version: v2+
41
+ anchor: filter-control
42
+ - keyword: attribute
43
+ description: Define custom route attribute
44
+ detail:
45
+ Create a custom route attribute that can be attached to routes and used
46
+ in filters.
47
+ diff: same
48
+ version: v2+
49
+ anchor: opt-attribute
50
+ - keyword: babel
51
+ description: Babel routing protocol
52
+ detail: A loop-avoiding distance-vector routing protocol that is robust and
53
+ efficient.
54
+ diff: same
55
+ version: v2+
56
+ anchor: proto-babel
57
+ - keyword: bfd
58
+ description: Bidirectional Forwarding Detection
59
+ detail:
60
+ Fast failure detection protocol that can be used by other protocols like
61
+ BGP and OSPF.
62
+ diff: same
63
+ version: v2+
64
+ anchor: proto-bfd
65
+ - keyword: bgp
66
+ description: BGP protocol
67
+ detail:
68
+ Border Gateway Protocol - the de facto standard for inter-domain routing
69
+ on the Internet.
70
+ diff: same
71
+ version: v2+
72
+ anchor: proto-bgp
73
+ - keyword: case
74
+ description: Case statement
75
+ detail: Multi-way branch based on expression value.
76
+ diff: same
77
+ version: v2+
78
+ anchor: filter-control
79
+ - keyword: cork threshold
80
+ description: Cork threshold (v3 only)
81
+ detail: Memory pressure control threshold for batching updates.
82
+ diff: added
83
+ version: v3+
84
+ anchor: rtable-cork-threshold
85
+ notes:
86
+ v3: "v3 only: Memory pressure control."
87
+ - keyword: debug
88
+ description: Table debug options
89
+ detail:
90
+ Enable debugging for routing table operations. v3 has simplified option
91
+ set.
92
+ diff: modified
93
+ version: v2-v3
94
+ anchors:
95
+ v2: table-debug
96
+ v3: rtable-debug
97
+ notes:
98
+ v3: "v3 Breaking Change: Options simplified to {states|routes|events}"
99
+ - keyword: debug latency
100
+ description: Enable latency debugging
101
+ detail: Enable debugging of scheduling latency. v3 extends this to support
102
+ granular event type filtering.
103
+ diff: modified
104
+ version: v2-v3
105
+ anchor: opt-debug-latency
106
+ notes:
107
+ v3: "v3 Breaking Change: Extended to
108
+ {ping|wakeup|scheduling|sockets|events|timers} for granular control."
109
+ - keyword: debug tables
110
+ description: Enable routing table debugging
111
+ detail: Log detailed information about routing table operations and state changes.
112
+ diff: same
113
+ version: v2+
114
+ anchor: opt-debug-tables
115
+ - keyword: define
116
+ description: Define a constant value
117
+ detail: Create a named constant that can be referenced throughout the
118
+ configuration.
119
+ diff: same
120
+ version: v2+
121
+ anchor: opt-define
122
+ - keyword: defined
123
+ description: Check if symbol is defined
124
+ detail: Test whether a symbol (attribute, route property) is defined.
125
+ diff: same
126
+ version: v2+
127
+ anchor: filter-operators
128
+ - keyword: description
129
+ description: Protocol description
130
+ detail: Add a human-readable description to the protocol for administrative
131
+ purposes.
132
+ diff: same
133
+ version: v2+
134
+ anchor: proto-description
135
+ - keyword: device
136
+ description: Device scan protocol
137
+ detail:
138
+ Scan network interfaces for link state changes and generate routes for
139
+ directly connected networks.
140
+ diff: same
141
+ version: v2+
142
+ anchor: proto-device
143
+ - keyword: direct
144
+ description: Direct routes protocol
145
+ detail: Generate routes for directly connected networks based on interface
146
+ addresses.
147
+ diff: same
148
+ version: v2+
149
+ anchor: proto-direct
150
+ - keyword: disabled
151
+ description: Disable protocol on startup
152
+ detail: Start the protocol in disabled state. Can be enabled later via CLI.
153
+ diff: same
154
+ version: v2+
155
+ anchor: proto-disabled
156
+ - keyword: else
157
+ description: Else clause
158
+ detail: Marks the beginning of statements to execute when condition is false.
159
+ diff: same
160
+ version: v2+
161
+ anchor: filter-control
162
+ - keyword: eval
163
+ description: Evaluate expression at config load time
164
+ detail: Execute a filter expression during configuration parsing. Useful for
165
+ dynamic configuration.
166
+ diff: same
167
+ version: v2+
168
+ anchor: opt-eval
169
+ - keyword: export
170
+ description: Export filter for channel
171
+ detail: Specify filter for routes exported from the routing table to the protocol.
172
+ diff: modified
173
+ version: v2-v3
174
+ anchor: channel-export
175
+ notes:
176
+ v3: "v3 Enhanced: Supports 'export in prefix' syntax for selective export."
177
+ - keyword: export block
178
+ description: Export block size (v3 only)
179
+ detail: Configure bulk export block size for improved performance.
180
+ diff: added
181
+ version: v3+
182
+ anchor: channel-export-block
183
+ notes:
184
+ v3: "v3 only: Bulk export optimization."
185
+ - keyword: export limit
186
+ description: Export route limit
187
+ detail: Set maximum number of routes that can be exported to the peer.
188
+ diff: same
189
+ version: v2+
190
+ anchor: channel-export-limit
191
+ - keyword: export settle time
192
+ description: Export settle time (v3 only)
193
+ detail: Time to wait before exporting route changes to protocols.
194
+ diff: added
195
+ version: v3+
196
+ anchor: rtable-export-settle-time
197
+ notes:
198
+ v3: "v3 only: Replaces min/max settle time from v2."
199
+ - keyword: filter
200
+ description: Define a routing filter
201
+ detail: Create a named filter that can be used to accept, reject, or modify
202
+ routes during import/export.
203
+ diff: same
204
+ version: v2+
205
+ anchor: opt-filter
206
+ - keyword: function
207
+ description: Define a reusable filter function
208
+ detail:
209
+ Create a named function that can be called from filters. Supports typed
210
+ parameters and return values.
211
+ diff: same
212
+ version: v2+
213
+ anchor: opt-function
214
+ - keyword: gc period
215
+ description: Garbage collection period
216
+ detail: Set the interval between garbage collection runs.
217
+ diff: same
218
+ version: v2+
219
+ anchor: rtable-gc-period
220
+ - keyword: gc threshold
221
+ description: Garbage collection threshold
222
+ detail: Configure the garbage collection threshold for the routing table.
223
+ diff: same
224
+ version: v2+
225
+ anchor: rtable-gc-threshold
226
+ - keyword: graceful restart wait
227
+ description: Set graceful restart timeout
228
+ detail: Configure how long to wait for protocols to recover after a graceful
229
+ restart.
230
+ diff: same
231
+ version: v2+
232
+ anchor: opt-graceful-restart-wait
233
+ - keyword: hostname
234
+ description: Set router hostname
235
+ detail: Override the system hostname used in protocol announcements and logging.
236
+ diff: same
237
+ version: v2+
238
+ anchor: opt-hostname
239
+ - keyword: if
240
+ description: Conditional statement
241
+ detail: Execute statements conditionally based on a boolean expression.
242
+ diff: same
243
+ version: v2+
244
+ anchor: filter-control
245
+ - keyword: import
246
+ description: Import filter for channel
247
+ detail: Specify filter for routes imported from the protocol to the routing table.
248
+ diff: same
249
+ version: v2+
250
+ anchor: channel-import
251
+ - keyword: import keep filtered
252
+ description: Keep filtered routes
253
+ detail:
254
+ Store routes that were filtered out during import, allowing them to be
255
+ examined.
256
+ diff: same
257
+ version: v2+
258
+ anchor: channel-import-keep-filtered
259
+ - keyword: import limit
260
+ description: Import route limit
261
+ detail: Set maximum number of routes that can be imported from this channel.
262
+ diff: same
263
+ version: v2+
264
+ anchor: channel-import-limit
265
+ - keyword: include
266
+ description: Include another configuration file
267
+ detail: Include and parse another configuration file at this point. Supports
268
+ glob patterns for including multiple files.
269
+ diff: same
270
+ version: v2+
271
+ anchor: opt-include
272
+ - keyword: int
273
+ description: Integer data type
274
+ detail: A signed 32-bit integer.
275
+ diff: same
276
+ version: v2+
277
+ anchor: filter-data-types
278
+ - keyword: interface
279
+ description: Configure protocol interfaces
280
+ detail: Define which interfaces this protocol operates on and their specific
281
+ settings.
282
+ diff: same
283
+ version: v2+
284
+ anchor: proto-iface
285
+ - keyword: ip
286
+ description: IP address data type
287
+ detail: An IPv4 or IPv6 address.
288
+ diff: same
289
+ version: v2+
290
+ anchor: filter-data-types
291
+ - keyword: ipv4
292
+ description: IPv4 channel
293
+ detail: Define an IPv4 address family channel for route exchange.
294
+ diff: same
295
+ version: v2+
296
+ anchor: channel-opts
297
+ - keyword: ipv6
298
+ description: IPv6 channel
299
+ detail: Define an IPv6 address family channel for route exchange.
300
+ diff: same
301
+ version: v2+
302
+ anchor: channel-opts
303
+ - keyword: kernel
304
+ description: Kernel synchronization protocol
305
+ detail:
306
+ Synchronize routes between BIRD and the operating system kernel routing
307
+ table.
308
+ diff: same
309
+ version: v2+
310
+ anchor: proto-kernel
311
+ - keyword: label policy
312
+ description: MPLS label policy
313
+ detail: Configure how MPLS labels are assigned and distributed.
314
+ diff: same
315
+ version: v2+
316
+ anchor: mpls-label-policy
317
+ - keyword: label range
318
+ description: MPLS label range
319
+ detail: Define the range of MPLS labels to use.
320
+ diff: same
321
+ version: v2+
322
+ anchor: mpls-label-range
323
+ - keyword: local as
324
+ description: Set local AS number (BGP)
325
+ detail: Configure the local Autonomous System number for BGP sessions.
326
+ diff: same
327
+ version: v2+
328
+ anchor: proto-bgp
329
+ - keyword: log
330
+ description: Configure logging destination and format
331
+ detail:
332
+ Set log output to stderr, syslog, or a file. BIRD 3 adds 'fixed' option
333
+ for ring buffer logging.
334
+ diff: modified
335
+ version: v2-v3
336
+ anchor: opt-log
337
+ notes:
338
+ v3: v3 adds 'fixed' ring buffer option for memory-constrained environments.
339
+ - keyword: max latency
340
+ description: Set maximum latency for thread group (v3 only)
341
+ detail: Configure the maximum allowed latency for threads in a thread group
342
+ before warnings.
343
+ diff: added
344
+ version: v3+
345
+ anchor: thread-setup
346
+ notes:
347
+ v3: "v3 only: Thread group performance tuning option."
348
+ - keyword: max settle time
349
+ description: Maximum settle time (v2 only)
350
+ detail: Maximum time to wait before announcing route changes. Removed in v3.
351
+ diff: removed
352
+ version: v2
353
+ anchor: rtable-max-settle-time
354
+ notes:
355
+ v3: "v3: Removed - use export settle time instead"
356
+ - keyword: min settle time
357
+ description: Minimum settle time (v2 only)
358
+ detail: Minimum time to wait before announcing route changes. Removed in v3.
359
+ diff: removed
360
+ version: v2
361
+ anchor: rtable-min-settle-time
362
+ notes:
363
+ v3: "v3: Removed - use export settle time instead"
364
+ - keyword: mpls domain
365
+ description: Define an MPLS domain
366
+ detail: Create a named MPLS domain for label distribution and MPLS forwarding.
367
+ diff: same
368
+ version: v2+
369
+ anchor: mpls-opts
370
+ - keyword: mrtdump
371
+ description: Configure MRT dump output
372
+ detail: Set up MRT format dump for BGP updates and routing table dumps for
373
+ analysis.
374
+ diff: same
375
+ version: v2+
376
+ anchor: opt-mrtdump
377
+ - keyword: multihop
378
+ description: Enable BGP multihop
379
+ detail: Allow BGP sessions to non-directly connected peers with optional TTL
380
+ specification.
381
+ diff: same
382
+ version: v2+
383
+ anchor: proto-bgp
384
+ - keyword: neighbor
385
+ description: Set BGP neighbor
386
+ detail: Configure the IP address and AS number of the BGP peer.
387
+ diff: same
388
+ version: v2+
389
+ anchor: proto-bgp
390
+ - keyword: ospf
391
+ description: OSPF protocol
392
+ detail: Open Shortest Path First - a link-state interior gateway protocol.
393
+ diff: same
394
+ version: v2+
395
+ anchor: proto-ospf
396
+ - keyword: password
397
+ description: Configure protocol authentication
398
+ detail: Set authentication password for protocols that support it (BGP, OSPF).
399
+ diff: same
400
+ version: v2+
401
+ anchor: proto-password
402
+ - keyword: pipe
403
+ description: Protocol pipe
404
+ detail:
405
+ Connect two routing tables, forwarding routes between them with optional
406
+ filtering.
407
+ diff: same
408
+ version: v2+
409
+ anchor: proto-pipe
410
+ - keyword: preference
411
+ description: Route preference value
412
+ detail:
413
+ Set the preference value for routes from this channel. Higher values are
414
+ preferred.
415
+ diff: same
416
+ version: v2+
417
+ anchor: channel-preference
418
+ - keyword: prefix
419
+ description: Prefix data type
420
+ detail: An IP address prefix consisting of an IP address and a prefix length.
421
+ diff: same
422
+ version: v2+
423
+ anchor: filter-data-types
424
+ - keyword: print
425
+ description: Print debug output
426
+ detail: Output debug information during filter execution.
427
+ diff: same
428
+ version: v2+
429
+ anchor: filter-functions
430
+ - keyword: protocol
431
+ description: Define a routing protocol instance
432
+ detail:
433
+ Create a named instance of a routing protocol (BGP, OSPF, etc.) with its
434
+ configuration.
435
+ diff: same
436
+ version: v2+
437
+ anchor: opt-protocol
438
+ - keyword: receive limit
439
+ description: Receive route limit
440
+ detail: Set maximum number of routes that can be received from the peer.
441
+ diff: same
442
+ version: v2+
443
+ anchor: channel-receive-limit
444
+ - keyword: reject
445
+ description: Reject route
446
+ detail: Reject the current route and stop processing the filter.
447
+ diff: same
448
+ version: v2+
449
+ anchor: filter-control
450
+ - keyword: restart time limit
451
+ description: Automatic restart time limit (v3 only)
452
+ detail: Configure automatic restart of the protocol after failure within
453
+ specified time limit.
454
+ diff: added
455
+ version: v3+
456
+ anchor: proto-restart-time-limit
457
+ notes:
458
+ v3: "v3 only: Automatic protocol restart on failure."
459
+ - keyword: return
460
+ description: Return from function
461
+ detail: Return a value from a filter function.
462
+ diff: same
463
+ version: v2+
464
+ anchor: filter-functions
465
+ - keyword: rip
466
+ description: RIP protocol
467
+ detail: Routing Information Protocol - a distance-vector interior gateway protocol.
468
+ diff: same
469
+ version: v2+
470
+ anchor: proto-rip
471
+ - keyword: router id
472
+ description: Set BIRD's router ID
473
+ detail:
474
+ "Router ID is a 4-byte integer that should be unique within an AS. It is
475
+ used to identify the router in routing protocols. Default: the lowest IPv4
476
+ address of the router."
477
+ diff: same
478
+ version: v2+
479
+ anchor: opt-router-id
480
+ - keyword: router id from
481
+ description: Derive router ID from interface
482
+ detail:
483
+ Automatically determine the router ID from the lowest IP address of the
484
+ specified interface.
485
+ diff: same
486
+ version: v2+
487
+ anchor: opt-router-id-from
488
+ - keyword: rpki reload
489
+ description: RPKI reload behavior
490
+ detail: Configure how routes are reloaded when RPKI validation state changes.
491
+ diff: modified
492
+ version: v2-v3
493
+ anchor: channel-rpki-reload
494
+ notes:
495
+ v3: "v3 Enhanced: Supports both ROA and ASPA validation reload."
496
+ - keyword: sorted
497
+ description: Enable sorted table mode
498
+ detail: Keep routes sorted for faster route lookups.
499
+ diff: same
500
+ version: v2+
501
+ anchor: rtable-sorted
502
+ - keyword: static
503
+ description: Static routes protocol
504
+ detail: Define static routes that are not learned from any routing protocol.
505
+ diff: same
506
+ version: v2+
507
+ anchor: proto-static
508
+ - keyword: string
509
+ description: String data type
510
+ detail: A sequence of characters.
511
+ diff: same
512
+ version: v2+
513
+ anchor: filter-data-types
514
+ - keyword: table
515
+ description: Define a routing table
516
+ detail:
517
+ Create a named routing table to store routes. Tables can be associated
518
+ with channels for import/export.
519
+ diff: same
520
+ version: v2+
521
+ anchor: rtable-opts
522
+ - keyword: table
523
+ description: Associate channel with routing table
524
+ detail: Specify which routing table this channel imports to and exports from.
525
+ diff: same
526
+ version: v2+
527
+ anchor: channel-table
528
+ - keyword: template
529
+ description: Define a protocol template
530
+ detail:
531
+ Create a reusable protocol configuration template that can be inherited
532
+ by other protocols.
533
+ diff: same
534
+ version: v2+
535
+ anchor: opt-template
536
+ - keyword: then
537
+ description: Then clause
538
+ detail: Marks the beginning of statements to execute when condition is true.
539
+ diff: same
540
+ version: v2+
541
+ anchor: filter-control
542
+ - keyword: thread group
543
+ description: Configure thread groups for multi-threading (v3 only)
544
+ detail: Define a thread group for running protocol and channel tasks in
545
+ parallel. BIRD 3.0+ supports multi-threading with configurable thread
546
+ groups.
547
+ diff: added
548
+ version: v3+
549
+ anchor: thread-setup
550
+ notes:
551
+ v3:
552
+ "v3.2.0+: BIRD runs in several threads with configurable thread groups for
553
+ different workloads."
554
+ - keyword: thread group
555
+ description: Assign protocol to thread group (v3 only)
556
+ detail: Specify which thread group should handle this protocol's tasks.
557
+ diff: added
558
+ version: v3+
559
+ anchor: proto-thread-group
560
+ notes:
561
+ v3: "v3 only: Multi-threading support for protocol tasks."
562
+ - keyword: threads
563
+ description: Set number of threads (deprecated in v3)
564
+ detail: Configure the number of worker threads. In v3, use 'thread group'
565
+ instead for more granular control.
566
+ diff: modified
567
+ version: v2-v3
568
+ anchors:
569
+ v2: opt-threads
570
+ v3: thread-setup
571
+ notes:
572
+ v3: "v3: Deprecated in favor of 'thread group' configuration blocks."
573
+ - keyword: timeformat
574
+ description: Set time format for logging
575
+ detail: Configure the format string used for timestamps in log messages.
576
+ diff: same
577
+ version: v2+
578
+ anchor: opt-timeformat
579
+ - keyword: trie
580
+ description: Use trie data structure
581
+ detail: Store routes in a trie data structure for optimized longest-prefix
582
+ matching.
583
+ diff: same
584
+ version: v2+
585
+ anchor: rtable-trie
586
+ - keyword: vrf
587
+ description: Bind protocol to VRF
588
+ detail:
589
+ Associate this protocol with a specific Virtual Routing and Forwarding
590
+ instance.
591
+ diff: same
592
+ version: v2+
593
+ anchor: proto-vrf
594
+ - keyword: watchdog warning
595
+ description: Set watchdog warning threshold
596
+ detail: Configure the time threshold after which a warning is logged if the
597
+ scheduler doesn't respond.
598
+ diff: same
599
+ version: v2+
600
+ anchor: opt-watchdog-warning
@@ -0,0 +1,5 @@
1
+ import { type Hover, type Position } from "vscode-languageserver/node.js";
2
+ import { TextDocument } from "vscode-languageserver-textdocument";
3
+ import type { ParsedBirdDocument } from "@birdcc/parser";
4
+ export declare const createHoverFromParsed: (parsed: ParsedBirdDocument, document: TextDocument, position: Position) => Hover | null;
5
+ //# sourceMappingURL=hover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../src/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,QAAQ,EAEd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AA8EzD,eAAO,MAAM,qBAAqB,GAChC,QAAQ,kBAAkB,EAC1B,UAAU,YAAY,EACtB,UAAU,QAAQ,KACjB,KAAK,GAAG,IAiCV,CAAC"}
package/dist/hover.js ADDED
@@ -0,0 +1,81 @@
1
+ import { declarationMetadata, isPositionInRange, KEYWORD_DOCS, toLspRange, } from "./shared.js";
2
+ const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3
+ const keywordAtPosition = (document, position) => {
4
+ const text = document.getText();
5
+ const positionOffset = document.offsetAt(position);
6
+ if (positionOffset < 0 || positionOffset > text.length) {
7
+ return null;
8
+ }
9
+ const keywords = Object.keys(KEYWORD_DOCS).sort((left, right) => right.length - left.length);
10
+ for (const keyword of keywords) {
11
+ const keywordPattern = new RegExp(`\\b${escapeRegExp(keyword).replaceAll("\\ ", "\\\\s+")}\\b`, "gi");
12
+ let match = keywordPattern.exec(text);
13
+ while (match) {
14
+ const start = match.index;
15
+ const end = start + match[0].length;
16
+ if (positionOffset >= start && positionOffset <= end) {
17
+ return {
18
+ word: keyword,
19
+ range: {
20
+ start: document.positionAt(start),
21
+ end: document.positionAt(end),
22
+ },
23
+ };
24
+ }
25
+ match = keywordPattern.exec(text);
26
+ }
27
+ }
28
+ const isWordChar = (char) => /[A-Za-z_]/.test(char);
29
+ let start = positionOffset;
30
+ while (start > 0 && isWordChar(text[start - 1] ?? "")) {
31
+ start -= 1;
32
+ }
33
+ let end = positionOffset;
34
+ while (end < text.length && isWordChar(text[end] ?? "")) {
35
+ end += 1;
36
+ }
37
+ if (start === end) {
38
+ return null;
39
+ }
40
+ const word = text.slice(start, end).toLowerCase();
41
+ const startPosition = document.positionAt(start);
42
+ const endPosition = document.positionAt(end);
43
+ return {
44
+ word,
45
+ range: {
46
+ start: startPosition,
47
+ end: endPosition,
48
+ },
49
+ };
50
+ };
51
+ export const createHoverFromParsed = (parsed, document, position) => {
52
+ for (const declaration of parsed.program.declarations) {
53
+ const metadata = declarationMetadata(declaration);
54
+ if (!metadata || !isPositionInRange(position, metadata.selectionRange)) {
55
+ continue;
56
+ }
57
+ return {
58
+ contents: {
59
+ kind: "markdown",
60
+ value: metadata.hoverMarkdown,
61
+ },
62
+ range: toLspRange(metadata.selectionRange),
63
+ };
64
+ }
65
+ const keyword = keywordAtPosition(document, position);
66
+ if (!keyword) {
67
+ return null;
68
+ }
69
+ const keywordDoc = KEYWORD_DOCS[keyword.word];
70
+ if (!keywordDoc) {
71
+ return null;
72
+ }
73
+ return {
74
+ contents: {
75
+ kind: "markdown",
76
+ value: `**${keyword.word}**\n\n${keywordDoc}`,
77
+ },
78
+ range: keyword.range,
79
+ };
80
+ };
81
+ //# sourceMappingURL=hover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover.js","sourceRoot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kB,EACJ,EAAE;IAChB,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QACtD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YACvE,SAAS;QACX,CAAC;QAED,OAAO;YACL,QAAQ,EAAE;gBACR,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ,CAAC,aAAa;aAC9B;YACD,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC;SAC3C,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,KAAK,OAAO,CAAC,IAAI,SAAS,UAAU,EAAE;SAC9C;QACD,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { createCompletionItemsFromParsed } from "./completion.js";
2
+ export type { CompletionContextOptions } from "./completion.js";
3
+ export { createDefinitionLocations } from "./definition.js";
4
+ export { toInternalErrorDiagnostic, toLspDiagnostic } from "./diagnostic.js";
5
+ export { createDocumentSymbolsFromParsed } from "./document-symbol.js";
6
+ export { createHoverFromParsed } from "./hover.js";
7
+ export { createReferenceLocations } from "./references.js";
8
+ export { startLspServer } from "./lsp-server.js";
9
+ //# sourceMappingURL=index.d.ts.map