@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.
- package/.oxfmtrc.json +16 -0
- package/LICENSE +674 -0
- package/README.md +343 -0
- package/dist/completion.d.ts +8 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +137 -0
- package/dist/completion.js.map +1 -0
- package/dist/definition.d.ts +5 -0
- package/dist/definition.d.ts.map +1 -0
- package/dist/definition.js +21 -0
- package/dist/definition.js.map +1 -0
- package/dist/diagnostic.d.ts +6 -0
- package/dist/diagnostic.d.ts.map +1 -0
- package/dist/diagnostic.js +38 -0
- package/dist/diagnostic.js.map +1 -0
- package/dist/document-symbol.d.ts +4 -0
- package/dist/document-symbol.d.ts.map +1 -0
- package/dist/document-symbol.js +20 -0
- package/dist/document-symbol.js.map +1 -0
- package/dist/hover-docs.d.ts +5 -0
- package/dist/hover-docs.d.ts.map +1 -0
- package/dist/hover-docs.js +141 -0
- package/dist/hover-docs.js.map +1 -0
- package/dist/hover-docs.yaml +600 -0
- package/dist/hover.d.ts +5 -0
- package/dist/hover.d.ts.map +1 -0
- package/dist/hover.js +81 -0
- package/dist/hover.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/lsp-server.d.ts +3 -0
- package/dist/lsp-server.d.ts.map +1 -0
- package/dist/lsp-server.js +250 -0
- package/dist/lsp-server.js.map +1 -0
- package/dist/references.d.ts +5 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +48 -0
- package/dist/references.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +4 -0
- package/dist/server.js.map +1 -0
- package/dist/shared.d.ts +17 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +150 -0
- package/dist/shared.js.map +1 -0
- package/dist/symbol-utils.d.ts +17 -0
- package/dist/symbol-utils.d.ts.map +1 -0
- package/dist/symbol-utils.js +84 -0
- package/dist/symbol-utils.js.map +1 -0
- package/dist/validation.d.ts +21 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +47 -0
- package/dist/validation.js.map +1 -0
- package/package.json +45 -0
- package/scripts/copy-hover-yaml.mjs +14 -0
- package/src/completion.ts +223 -0
- package/src/definition.ts +50 -0
- package/src/diagnostic.ts +48 -0
- package/src/document-symbol.ts +27 -0
- package/src/hover-docs.ts +223 -0
- package/src/hover-docs.yaml +600 -0
- package/src/hover.ts +122 -0
- package/src/index.ts +8 -0
- package/src/lsp-server.ts +350 -0
- package/src/references.ts +107 -0
- package/src/server.ts +4 -0
- package/src/shared.ts +182 -0
- package/src/symbol-utils.ts +126 -0
- package/src/validation.ts +85 -0
- package/test/hover-docs.test.ts +18 -0
- package/test/lsp.test.ts +304 -0
- package/test/perf-baseline.test.ts +96 -0
- package/test/validation.test.ts +212 -0
- 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
|
package/src/hover.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Hover,
|
|
3
|
+
type Position,
|
|
4
|
+
type Range,
|
|
5
|
+
} from "vscode-languageserver/node.js";
|
|
6
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
7
|
+
import type { ParsedBirdDocument } from "@birdcc/parser";
|
|
8
|
+
import {
|
|
9
|
+
declarationMetadata,
|
|
10
|
+
isPositionInRange,
|
|
11
|
+
KEYWORD_DOCS,
|
|
12
|
+
toLspRange,
|
|
13
|
+
} from "./shared.js";
|
|
14
|
+
|
|
15
|
+
const escapeRegExp = (value: string): string =>
|
|
16
|
+
value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
17
|
+
|
|
18
|
+
const keywordAtPosition = (
|
|
19
|
+
document: TextDocument,
|
|
20
|
+
position: Position,
|
|
21
|
+
): { word: string; range: Range } | null => {
|
|
22
|
+
const text = document.getText();
|
|
23
|
+
const positionOffset = document.offsetAt(position);
|
|
24
|
+
|
|
25
|
+
if (positionOffset < 0 || positionOffset > text.length) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const keywords = Object.keys(KEYWORD_DOCS).sort(
|
|
30
|
+
(left, right) => right.length - left.length,
|
|
31
|
+
);
|
|
32
|
+
for (const keyword of keywords) {
|
|
33
|
+
const keywordPattern = new RegExp(
|
|
34
|
+
`\\b${escapeRegExp(keyword).replaceAll("\\ ", "\\\\s+")}\\b`,
|
|
35
|
+
"gi",
|
|
36
|
+
);
|
|
37
|
+
let match = keywordPattern.exec(text);
|
|
38
|
+
|
|
39
|
+
while (match) {
|
|
40
|
+
const start = match.index;
|
|
41
|
+
const end = start + match[0].length;
|
|
42
|
+
if (positionOffset >= start && positionOffset <= end) {
|
|
43
|
+
return {
|
|
44
|
+
word: keyword,
|
|
45
|
+
range: {
|
|
46
|
+
start: document.positionAt(start),
|
|
47
|
+
end: document.positionAt(end),
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
match = keywordPattern.exec(text);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const isWordChar = (char: string): boolean => /[A-Za-z_]/.test(char);
|
|
57
|
+
|
|
58
|
+
let start = positionOffset;
|
|
59
|
+
while (start > 0 && isWordChar(text[start - 1] ?? "")) {
|
|
60
|
+
start -= 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let end = positionOffset;
|
|
64
|
+
while (end < text.length && isWordChar(text[end] ?? "")) {
|
|
65
|
+
end += 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (start === end) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const word = text.slice(start, end).toLowerCase();
|
|
73
|
+
const startPosition = document.positionAt(start);
|
|
74
|
+
const endPosition = document.positionAt(end);
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
word,
|
|
78
|
+
range: {
|
|
79
|
+
start: startPosition,
|
|
80
|
+
end: endPosition,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const createHoverFromParsed = (
|
|
86
|
+
parsed: ParsedBirdDocument,
|
|
87
|
+
document: TextDocument,
|
|
88
|
+
position: Position,
|
|
89
|
+
): Hover | null => {
|
|
90
|
+
for (const declaration of parsed.program.declarations) {
|
|
91
|
+
const metadata = declarationMetadata(declaration);
|
|
92
|
+
if (!metadata || !isPositionInRange(position, metadata.selectionRange)) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
contents: {
|
|
98
|
+
kind: "markdown",
|
|
99
|
+
value: metadata.hoverMarkdown,
|
|
100
|
+
},
|
|
101
|
+
range: toLspRange(metadata.selectionRange),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const keyword = keywordAtPosition(document, position);
|
|
106
|
+
if (!keyword) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const keywordDoc = KEYWORD_DOCS[keyword.word];
|
|
111
|
+
if (!keywordDoc) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
contents: {
|
|
117
|
+
kind: "markdown",
|
|
118
|
+
value: `**${keyword.word}**\n\n${keywordDoc}`,
|
|
119
|
+
},
|
|
120
|
+
range: keyword.range,
|
|
121
|
+
};
|
|
122
|
+
};
|