~/bend-docscommunity

src/lsp/report.bend checks

raw source on the hub · import 0x013e0f9a479bbebad5ed196725eede95/src/lsp/report.bend as Report

lsp/report: the checker's text, as diagnostics. bend prints an error as Error: (or Error: a one-line message) - expected : .. the message lines, then Context: and its lines Location: name bend's key for the def: name in this file, the import's namespace first in another (m.g, ../m.g) 4>| x the source excerpt; >| marks the line, 1-based There are no columns, so a diagnostic covers its whole line. An error in an import cannot be placed in this file: it lands on line 0, naming its home. Which errors are this file's is read against the file's own keys (mine).

2 imports
import Base
import ../lazy/lazy.bend as Lazy

Types

type Diag source · line 14 · raw

Data

line is 0-based, as LSP counts

type Line source · line 18 · raw

Data

a line of the checker's report, by what it starts with

type Raw source · line 26 · raw

Data

an error bend reported, before it is placed: where it is (the Location's name, bend's key for its def), the line it marks (1-based, 0 for none), and its message

type St source · line 30 · raw

Data

msg and out are reversed

Definitions

def classify source · line 34 · raw

@+ss:String -> Line

a report line's kind

def marker.go source · line 40 · raw

@ss:String -> @+whole:String -> @+count:Nat -> Maybe<&2, U32>

reading a marker past its padding: count digits of whole so far, and at the first other character, the number they make when >| follows them

def marker source · line 52 · raw

@ss:String -> Maybe<&2, U32>

the line number a source line of the report carries, when it does: 12>| code marks line 12, padding before the digits aside; a line of context (11 | code) marks none, whatever its code holds

def clean source · line 57 · raw

@+ss:String -> String

a message line, without its -

def is_nag source · line 61 · raw

@+ss:String -> Bool

bend's "N is available: run bend update" is not part of a diagnostic

def push source · line 65 · raw

@+ss:String -> @+msg:List<&2, String> -> List<&2, String>

a non-empty, non-nag line onto the message

def flush source · line 70 · raw

@seen:Bool -> @msg:List<&2, String> -> @+line:U32 -> @+place:String -> @+out:List<&2, Raw> -> List<&2, Raw>

the error so far, its message lines reversed, onto the ones before it; "no main to run" is a library, not an error

def step.go source · line 75 · raw

@kk:Line -> @located:Bool -> @seen:Bool -> @msg:List<&2, String> -> @+line:U32 -> @place:String -> @out:List<&2, Raw> -> St

def step source · line 97 · raw

@ss:String -> @st:St -> St

one report line

def run source · line 102 · raw

@lines:List<&2, String> -> @st:St -> St

every report line, in order

def finish source · line 110 · raw

@st:St -> List<&2, Raw>

the errors once the lines are over, a pending one flushed

def stem source · line 116 · raw

@ss:String -> String

the text before the first ~: an instance of a template (f~1) is the template's

def owns source · line 124 · raw

@names:List<&2, String> -> @+name:String -> Bool

is the name among these?

def mine source · line 136 · raw

@names:Maybe<&2, List<&2, String>> -> @+place:String -> Bool

is an error at this place in the checked file? With the file's names (bend's keys for its items, checker/names.bend): when the place is one of them or names nothing. Without them: when the place holds no path. bend names a def of an import beside the file with no path (m.g), so only the names tell it from a def m.g of the file

def diag.at source · line 145 · raw

@+own:Bool -> @+place:String -> @+line:U32 -> @+body:String -> Diag

an error placed: on its marked line, 0-based, in the checked file; on line 0, its message headed by where it is, in another file

def diag source · line 150 · raw

@names:Maybe<&2, List<&2, String>> -> @rr:Raw -> Diag

an error placed, by the checked file's names

def diags source · line 155 · raw

@rs:List<&2, Raw> -> @+names:Maybe<&2, List<&2, String>> -> List<&2, Diag>

every error placed

def parse_in source · line 164 · raw

@+names:Maybe<&2, List<&2, String>> -> @text:String -> List<&2, Diag>

the checker's text as diagnostics, placed by the checked file's names when they are known