A type printer that shortens types by replacing fully qualified names with shortened versions.
The printer supports symbol renames found in scope and will use the rename if it is available. It also handle custom renames as specified in the renameConfigMap
parameter.
Attributes
Members list
Type members
Classlikes
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SymbolRenameSearchResultclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait SymbolRenameSearchResultclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Compute method signature for the given (method) symbol.
Compute method signature for the given (method) symbol.
Attributes
- Returns
-
shortened name for types or the type for terms e.g. "[A: Ordering](a: A, b: B): collection.mutable.Map[A, B]" ": collection.mutable.Map[A, B]" for no-arg method
Returns a list of TextEdits (auto-imports) of the symbols
Returns a list of TextEdits (auto-imports) of the symbols
Attributes
Textual representation of type
Textual representation of type
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
The string representation of type prefix, including separator
The string representation of type prefix, including separator
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
Attributes
- Definition Classes
-
PlainPrinter
Inherited methods
Attributes
- Inherited from:
- RefinedPrinter
Usual target for Annotation#toText
, overridden in RefinedPrinter
Usual target for Annotation#toText
, overridden in RefinedPrinter
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- PlainPrinter
Generate text using op
, assuming a given precedence level prec
.
Generate text using op
, assuming a given precedence level prec
.
atPrec
vs changePrec
This is to be used when changing precedence inside some sort of parentheses: for instance, to print T[A]
use toText(T) ~ '[' ~ atPrec(GlobalPrec) { toText(A) } ~ ']'
.
If the presence of the parentheses depends on precedence, inserting them manually is most certainly a bug. Use changePrec
instead to generate them exactly when needed.
Attributes
- Inherited from:
- Printer
Generate text using op
, assuming a given precedence level prec
. If new level prec
is lower than previous level, put text in parentheses.
Generate text using op
, assuming a given precedence level prec
. If new level prec
is lower than previous level, put text in parentheses.
atPrec
vs changePrec
To pretty-print A op B
, you need something like changePrec(parsing.precedence(op, isType)) { toText(a) ~ op ~ toText(b) }
// BUGGY that will insert parentheses around A op B
if, for instance, the preceding operator has higher precedence.
But that does not handle infix operators with left- or right- associativity.
If op and op' have the same precedence and associativity, A op B op' C parses as (A op B) op' C if op and op' are left-associative, and as A op (B op' C) if they're right-associative, so we need respectively
val prec = parsing.precedence(op)
// either:
changePrec(prec) { toText(a) ~ op ~ atPrec(prec + 1) { toText(b) } } // for left-associative op and op'
// or:
changePrec(prec) { atPrec(prec + 1) { toText(a) } ~ op ~ toText(b) } // for right-associative op and op'
Attributes
- Inherited from:
- Printer
The current precedence level. When pretty-printing arguments of operator op
, currentPrecedence
must equal op
's precedence level, so that pretty-printing expressions using lower-precedence operators can insert parentheses automatically by calling changePrec
.
The current precedence level. When pretty-printing arguments of operator op
, currentPrecedence
must equal op
's precedence level, so that pretty-printing expressions using lower-precedence operators can insert parentheses automatically by calling changePrec
.
Attributes
- Inherited from:
- Printer
Textual representation of single denotation's declaration
Textual representation of single denotation's declaration
Attributes
- Inherited from:
- PlainPrinter
Textual representation of symbol's declaration
Textual representation of symbol's declaration
Attributes
- Inherited from:
- PlainPrinter
Textual representation of all symbols in given list, using dclText
for displaying each.
Textual representation of all symbols in given list, using dclText
for displaying each.
Attributes
- Inherited from:
- PlainPrinter
A description of sym's location
A description of sym's location
Attributes
- Inherited from:
- PlainPrinter
The fully qualified name of the symbol
The fully qualified name of the symbol
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- PlainPrinter
Attributes
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- RefinedPrinter
String representation of symbol's kind.
String representation of symbol's kind.
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Textual representation of symbol and its location
Textual representation of symbol and its location
Attributes
- Inherited from:
- PlainPrinter
If symbol's owner is a printable class C, the text "in C", otherwise ""
If symbol's owner is a printable class C, the text "in C", otherwise ""
Attributes
- Inherited from:
- PlainPrinter
The name, possibly with with namespace suffix if debugNames is set: /L for local names, /V for other term names, /T for type names
The name, possibly with with namespace suffix if debugNames is set: /L for local names, /V for other term names, /T for type names
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
The name of the given symbol. If !settings.debug, the original name where expansions of operators are translated back to operator symbol. E.g. $eq => =. If settings.uniqid, adds id.
The name of the given symbol. If !settings.debug, the original name where expansions of operators are translated back to operator symbol. E.g. $eq => =. If settings.uniqid, adds id.
Attributes
- Inherited from:
- PlainPrinter
Attributes
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- RefinedPrinter
A plain printer without any embellishments
A plain printer without any embellishments
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
The context of all public methods in Printer and subclasses. Overridden in RefinedPrinter.
The context of all public methods in Printer and subclasses. Overridden in RefinedPrinter.
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Textual representation of denotation
Textual representation of denotation
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Textual representation, including symbol's kind e.g., "class Foo", "method Bar". If hasMeaninglessName is true, uses the owner's name to disambiguate identity.
Textual representation, including symbol's kind e.g., "class Foo", "method Bar". If hasMeaninglessName is true, uses the owner's name to disambiguate identity.
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Textual representation of tree
Textual representation of tree
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Textual representation of a GADT constraint
Textual representation of a GADT constraint
Attributes
- Inherited from:
- PlainPrinter
Textual representation of a constraint
Textual representation of a constraint
Attributes
- Inherited from:
- PlainPrinter
Textual representation of info relating to an import clause
Textual representation of info relating to an import clause
Attributes
- Inherited from:
- PlainPrinter
Textual representation of implicit search result
Textual representation of implicit search result
Attributes
- Inherited from:
- PlainPrinter
Textual representation of implicit candidates.
Textual representation of implicit candidates.
Attributes
- Inherited from:
- PlainPrinter
Textual representation of source position
Textual representation of source position
Attributes
- Inherited from:
- PlainPrinter
Textual representation of all definitions in a scope using dclText
for each
Textual representation of all definitions in a scope using dclText
for each
Attributes
- Inherited from:
- PlainPrinter
Textual representation of lambda param
Textual representation of lambda param
Attributes
- Inherited from:
- PlainPrinter
Textual representation of annotation
Textual representation of annotation
Attributes
- Inherited from:
- PlainPrinter
Textual representation of constant
Textual representation of constant
Attributes
- Inherited from:
- PlainPrinter
The name as a text
The name as a text
Attributes
- Inherited from:
- PlainPrinter
Render elements alternating with sep
string
Render elements alternating with sep
string
Attributes
- Inherited from:
- Printer
Textual representation of a reference in a capture set
Textual representation of a reference in a capture set
Attributes
- Inherited from:
- PlainPrinter
Textual representation of a reference in a capture set
Textual representation of a reference in a capture set
Attributes
- Inherited from:
- PlainPrinter
String representation of symbol's flags
String representation of symbol's flags
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter
- Inherited from:
- RefinedPrinter
Render elements within lowest precedence
Render elements within lowest precedence
Attributes
- Inherited from:
- Printer
Render element within lowest precedence
Render element within lowest precedence
Attributes
- Inherited from:
- Printer
Render elements within highest precedence
Render elements within highest precedence
Attributes
- Inherited from:
- Printer
Render element within highest precedence
Render element within highest precedence
Attributes
- Inherited from:
- Printer
The string representation of this type used as a prefix
The string representation of this type used as a prefix
Attributes
- Definition Classes
-
RefinedPrinter -> PlainPrinter -> Printer
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- RefinedPrinter
Attributes
- Inherited from:
- RefinedPrinter
Givens
Inherited givens
Attributes
- Inherited from:
- PlainPrinter
Extensions
Inherited extensions
Print modifiers from symbols if tree has type, overriding the behavior in Trees.
Print modifiers from symbols if tree has type, overriding the behavior in Trees.
Attributes
- Inherited from:
- RefinedPrinter