Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/server/src/projectNav

Click-to-navigate: the server half.

Cockpit server, next. Source: ui/server/src/projectNav.mjs.

Functions#

openReference()#

openReference(root, from, ref, start): object

Defined in: ui/server/src/projectNav.mjs:169

Follow one reference: from (root-relative path of the file being viewed) and ref (the name of a reference in it, plus optionally its character offset start when the name occurs many times). The target is derived here from the AST -- if the reference does not resolve, this refuses.

Parameters#

root

any

from

any

ref

any

start

any

Returns#

object

ok

ok: boolean = true

path

path: any

references

references: ({ column: any; end: any; kind: any; line: any; name: any; reason: any; start: any; target: any; } | { column: any; end: any; kind: any; line: any; name: any; reason: any; relation: { crossFeature: boolean; description: string; fromFeature: any; fromLayer: string; label: string; layers: string; toFeature: any; toLayer: string; }; start: any; target: any; })[]

source

source: any


openSourceLocation()#

openSourceLocation(root, file, line, column): object

Defined in: ui/server/src/projectNav.mjs:189

Open a bare project file at a known position: unlike openReference, there is no from file and no reference name to derive a target from -- the caller (the live preview's "Show in source" button) already has the exact project file and position, resolved client-side from the framed app's own error stack / data-cx-src annotation. Same containment as every other nav read here: resolveProjectFile's real-path-inside-root, non-node_modules, source-extension guard.

Parameters#

root

any

file

any

line

any

column

any

Returns#

object

ok

ok: boolean = true

path

path: any

references

references: ({ column: any; end: any; kind: any; line: any; name: any; reason: any; start: any; target: any; } | { column: any; end: any; kind: any; line: any; name: any; reason: any; relation: { crossFeature: boolean; description: string; fromFeature: any; fromLayer: string; label: string; layers: string; toFeature: any; toLayer: string; }; start: any; target: any; })[]

source

source: any


resolveProjectFile()#

resolveProjectFile(root, rel): any

Defined in: ui/server/src/projectNav.mjs:52

A client-supplied root-relative path -> real absolute path, or null (never throws, never reads).

Parameters#

root

any

rel

any

Returns#

any


viewPage()#

viewPage(root, feature, file): object

Defined in: ui/server/src/projectNav.mjs:149

First view: a page, through the editor's own pages/ guard.

Parameters#

root

any

feature

any

file

any

Returns#

object

ok

ok: boolean = true

path

path: any

references

references: ({ column: any; end: any; kind: any; line: any; name: any; reason: any; start: any; target: any; } | { column: any; end: any; kind: any; line: any; name: any; reason: any; relation: { crossFeature: boolean; description: string; fromFeature: any; fromLayer: string; label: string; layers: string; toFeature: any; toLayer: string; }; start: any; target: any; })[]

source

source: any


viewProjectFile()#

viewProjectFile(root, rel): object

Defined in: ui/server/src/projectNav.mjs:158

A file the flow view drew. The caller has already checked rel against that flow's own file list; the shared root-relative guard (no "..", no absolute, real path inside the root) runs again here.

Parameters#

root

any

rel

any

Returns#

object

ok

ok: boolean = true

path

path: any

references

references: ({ column: any; end: any; kind: any; line: any; name: any; reason: any; start: any; target: any; } | { column: any; end: any; kind: any; line: any; name: any; reason: any; relation: { crossFeature: boolean; description: string; fromFeature: any; fromLayer: string; label: string; layers: string; toFeature: any; toLayer: string; }; start: any; target: any; })[]

source

source: any