scala.meta.internal.pc.Completions
A case
completion showing the valid subtypes of the type being deconstructed.
A case
completion showing the valid subtypes of the type being deconstructed.
the match expression being deconstructed or EmptyTree
when
not in a match expression (for example List(1).foreach { case@@ }
.
the range in the original source file enclosing the case
keyword being completed.
Used as the position of the main text edit of the completion.
the position of the completion in the instrumented source file with _CURSOR_
instrumentation.
the text of the original source file without _CURSOR_
.
the parent tree node of the pattern match, for example Apply(_, _)
when in
List(1).foreach { cas@@ }
, used as fallback to compute the type of the selector when
it's EmptyTree
.
Completion for the name of a toplevel class, trait or object matching the filename.
Completion for the name of a toplevel class, trait or object matching the filename.
Example:
// src/main/scala/app/UserDatabaseService.scala class User@@ // completes "UserDatabaseService"
the toplevel class, trait or object definition.
the enclosing package definition.
the completion position.
the range to replace in the completion.
A completion to convert a string literal into a string literal, example "Hello $na@@"
.
A completion to convert a string literal into a string literal, example "Hello $na@@"
.
When converting a string literal into an interpolator we need to ensure a few cases:
- escape existing $
characters into $$
, which are printed as $$
in order to
escape the TextMate snippet syntax.
- wrap completed name in curly braces s"Hello ${name}_
when the trailing character
can be treated as an identifier part.
- insert the leading s
interpolator.
- place the cursor at the end of the completed name using TextMate $0
snippet syntax.
The string literal, includes an instrumented _CURSOR_
that we need to handle.
The offset position of the cursor, right below @@_CURSOR_
.
Metadata about this interpolation, the location of the leading dollar character and whether the completed name needs to be wrapped in curly braces.
The text of the original source code without the instrumented _CURSOR_
.
A completion to select type members inside string interpolators.
A completion to select type members inside string interpolators.
Example:
// before s"Hello $name.len@@!" // after s"Hello ${name.length()$0}"
the member query, "len" in the example above.
the identifier from where we select a member from, "name" above.
the string literal part of the interpolator trailing the identifier including cursor instrumentation, "len_CURSOR_!" in the example above.
the cursor position where the completion is triggered, @@
in the example above.
the text of the original source file without _CURSOR_
instrumentation.
A match
keyword completion to generate an exhaustive pattern match for sealed types.
A match
keyword completion to generate an exhaustive pattern match for sealed types.
the type of the qualifier being matched.
An override def
completion to implement methods from the supertype.
An override def
completion to implement methods from the supertype.
the name of the method being completed including the _CURSOR_
suffix.
the enclosing template for the class/object/trait we are implementing.
the position of the completion request, points to _CURSOR_
.
the text of the original source code without _CURSOR_
.
A completion inside a new expression, example new Array@@
A completion inside a type position, example val x: Map[Int, Strin@@]
Returns true if the identifier comes after an opening brace character '{'