Find a method definition right after the given position.
Find a method definition right after the given position.
A position to insert new imports
A position to insert new imports
the offset where to place the import.
the indentation at which to place the import.
whether the import needs to be padded on top in the case that it is the first one after the package def
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
.
Detects type member select from qualifiers that extend scala.Dynamic
.
Detects type member select from qualifiers that extend scala.Dynamic
.
By default, type member completions on classes that extend scala.Dynamic
return no results due to how Dynamic
desugars trees. This traverser
detects such cases and run a custom type member completion.
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_
.
the position start of the completion.
the determination of whether the symbol will be a possible completion item.
A Type
with custom pretty-printing representation, not used for typechecking.
A Type
with custom pretty-printing representation, not used for typechecking.
NOTE(olafur) Creating a new Type
subclass is a hack, a better long-term solution would be
to implement a custom pretty-printer for types so that we don't have to rely on Type.toString
.
A scaladoc completion showing the parameters of the given associated definition.
A scaladoc completion showing the parameters of the given associated definition.
the range in the original source file.
the memberDef associated with the scaladoc to complete. This class will construct scaladoc based on the params of this definition.
the position of the completion request.
the text of the original source code.
A member for symbols on the classpath that are not in scope, produced via workspace/symbol.
A member for symbols on the classpath that are not in scope, produced via workspace/symbol.
(Since version 2.11.0) Use Annotation.tree
to inspect annotation arguments
(Since version 2.11.0) Use Annotation.tree
to inspect annotation arguments
(Since version 2.11.0) Use internal.ReificationSupportApi
instead
(Since version 2.11.0) c.enclosingTree-style APIs are now deprecated; consult the scaladoc for more information
(Since version 2.11.0) Use Annotation.tree
to inspect annotation arguments
(Since version 2.11.0) Use Annotation.tree
to inspect annotation arguments
(Since version 2.11.0) Use Annotation.tree
to inspect annotation arguments
(Since version 2.11.0) Use ModifiersExtractor instead
(Since version 2.11.0) Use Annotation.tree
to inspect annotation arguments
(Since version 2.11.0) Use Annotation.tree
to inspect annotation arguments
(Since version 2.11.0) c.enclosingTree-style APIs are now deprecated; consult the scaladoc for more information
A completion inside a new expression, example new Array@@
A completion inside a new expression, example new Array@@
A completion inside a type position, example val x: Map[Int, Strin@@]
A completion inside a type position, example val x: Map[Int, Strin@@]
Returns true if the identifier comes after an opening brace character '{'
Returns true if the identifier comes after an opening brace character '{'
Returns the end offset of the identifier starting as the given offset position.
Returns the end offset of the identifier starting as the given offset position.
Returns the start offset of the identifier starting as the given offset position.
Returns the start offset of the identifier starting as the given offset position.
Converts a SemanticDB symbol into a compiler symbol.
Check if the cursor is located just behind the opening comment.
Check if the cursor is located just behind the opening comment.
The cursor position
The original text of the source file.
Custom Type.toLongString
that shortens fully qualified package prefixes.
Forwarder to package private typeMembers
method.
Forwarder to package private typeMembers
method.
Returns a high number for less relevant symbols and low number for relevant numbers.
Returns a high number for less relevant symbols and low number for relevant numbers.
Relevance is computed based on several factors such as - local vs global - public vs private - synthetic vs non-synthetic
Shortens fully qualified package prefixes to make type signatures easier to read.
Shortens fully qualified package prefixes to make type signatures easier to read.
It becomes difficult to read method signatures when they have a large number of parameters with fully qualified names. This method strips out package prefixes to shorten the names while making sure to not convert two different symbols into same short name.
(Since version 2.10.2) Use method that accepts fragments
(Since version 2.10.1) Use askLoadedTyped
instead to avoid race conditions in the typechecker
(Since version 2.10.0) Use enteringPhase
(Since version 2.11.0) Use devWarning if this is really a warning; otherwise use log
(Since version 2.11.0) Use noSelfType
instead
(Since version 2.11.0) Scaladoc is implemented with a custom Global; this flag is ignored
(Since version 2.10.1) Use isRawType
(Since version 2.10.1) Renamed to reportThrowable
(Since version 2.10.0) use genPolyType(...) instead
(Since version 2.11.0) Use explicit TermName(s)
instead
(Since version 2.11.0) Use explicit TypeName(s)
instead