Function
resolveEditorConnection
(
directory: string,
port: number | undefined,
discover: ((directory: string) => EditorConnection | undefined) | undefined,
)
Source from the content-addressed store, hash-verified
| 359 | }) |
| 360 | |
| 361 | function resolveEditorConnection( |
| 362 | directory: string, |
| 363 | port: number | undefined, |
| 364 | discover: ((directory: string) => EditorConnection | undefined) | undefined, |
| 365 | ): EditorConnection | undefined { |
| 366 | if (port) { |
| 367 | return { |
| 368 | url: `ws://127.0.0.1:${port}`, |
| 369 | source: `env:${port}`, |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | return discover?.(directory) |
| 374 | } |
| 375 | |
| 376 | export function editorSelectionKey(selection: EditorSelection | undefined) { |
| 377 | if (!selection) return "" |
Tested by
no test coverage detected