package metals
- Alphabetic
- Public
- All
Type Members
-
final
class
ActiveFiles extends AnyRef
Keeps track of files that have been "recently active"
Keeps track of files that have been "recently active"
Used to ignore file watching events that follow right after textDocument/didSave events.
-
final
case class
AggregateSemanticdbs(underlying: List[Semanticdbs]) extends Semanticdbs with Product with Serializable
Implements
TextDocumentstrait with a list of underlying implementations. -
final
class
BatchedFunction[A, B] extends (Seq[A]) ⇒ Future[B]
Helper to batch multiple asynchronous requests and ensure only one request is active at a time.
-
final
class
BloopInstall extends Cancelable
Runs
sbt bloopInstallprocesses.Runs
sbt bloopInstallprocesses.Handles responsibilities like: - install metals.sbt as a global sbt plugin - launching embedded sbt-launch.jar via system process - reporting client about
sbt bloopInstallprogress - sealed abstract class BloopInstallResult extends Product with Serializable
- final case class BloopProtocol(value: String) extends Product with Serializable
-
final
class
BloopServers extends AnyRef
Establishes a connection with a bloop server.
Establishes a connection with a bloop server.
Connects to a running bloop server instance if it is installed on the user machine and has compatible version (+v1.1.0). Ignores the installed bloop server instance if it is v1.0.0.
Otherwise, if the user doesn't have bloop installed on the machine, uses Coursier to fetch the jars for ch.epfl.scala:bloop-frontend and start a new bloop server using classloading. A bloop server that starts via classloading stops when when the metals server stops. Only metals can access the classloaded server, the user cannot call it from a command-line interface.
Eventually, this class may be superseded by "BSP connection protocol": https://github.com/scalacenter/bsp/blob/master/docs/bsp.md#bsp-connection-protocol
-
sealed
trait
BloopSocket extends Cancelable
We communicate with Bloop via one of.
We communicate with Bloop via one of.
- unix domain sockets (macos/linux) - tcp (current default on Windows) - named pipes (ideal default on Windows)
This class abstracts over each of these.
-
case class
Buffers(map: TrieMap[io.AbsolutePath, String] = TrieMap.empty) extends Product with Serializable
Manages in-memory text contents of unsaved files in the editor.
- sealed abstract class BuildChange extends Product with Serializable
-
case class
BuildServerConnection(workspace: io.AbsolutePath, client: MetalsBuildClient, server: MetalsBuildServer, cancelables: List[Cancelable], initializeResult: InitializeBuildResult)(implicit ec: ExecutionContext) extends Cancelable with Product with Serializable
An actively running and initialized BSP connection.
- class BuildServerInitializeException extends Exception
-
final
class
BuildTargets extends AnyRef
In-memory cache for looking up build server metadata.
- sealed abstract class BuildTool extends Product with Serializable
-
final
class
BuildTools extends AnyRef
Detects what build tool is used in this workspace.
Detects what build tool is used in this workspace.
Although we only support a limited set of build tools, knowing what build tool is used in the workspace helps to produce better error for people using unsupported build tools. For example: "Gradle is not supported" instead of "Unsupported build tool".
-
trait
Cancelable extends AnyRef
A copy of
java.io.Closeablethat is not auto closeable.A copy of
java.io.Closeablethat is not auto closeable.Gives us fine-grained control over when resources are cleaned up.
- case class Command(id: String, title: String, description: String) extends Product with Serializable
-
final
class
ConfiguredLanguageClient extends MetalsLanguageClient
Delegates requests/notifications to the underlying language client according to the user configuration.
Delegates requests/notifications to the underlying language client according to the user configuration.
This wrapper class manages differences in how editors interpret LSP endpoints slightly differently, especially the window/{logMessage,showMessage} notifications. For example, with vim-lsc the messages from window/logMessage are always visible in the UI while in VS Code the logs are hidden by default.
- sealed abstract class Confirmation extends AnyRef
-
final
class
DefinitionProvider extends AnyRef
Implements goto definition that works even in code that doesn't parse.
Implements goto definition that works even in code that doesn't parse.
Uses token edit-distance to align identifiers in the current open buffer with symbol occurrences from the latest SemanticDB snapshot.
The implementation logic for converting positions between the latest SemanticDB snapshot and current open buffer is quite hairy. We need to convert positions in both the "source" (where definition request is made) and the "destination" (location of the symbol definition). This requires using token edit distance twice:
- source: dirty buffer -> snapshot - destination: snapshot -> dirty buffer
- case class DefinitionResult(locations: java.util.List[Location], symbol: String, definition: Option[io.AbsolutePath], semanticdb: Option[TextDocument]) extends Product with Serializable
- final class DependencySources extends AnyRef
-
final
class
Diagnostics extends AnyRef
Converts diagnostics from the build server into LSP diagnostics.
Converts diagnostics from the build server into LSP diagnostics.
This conversion is a bit tricky because BSP and LSP have different semantics with how diagnostics are published:
- BSP publishes diagnostics as they come from the compiler, to know what diagnostics are active for a document we may need to aggregate multiple
build/publishDiagnosticsnotifications. - LSP requires that the lasttextDocument/publishDiagnosticsnotification includes all active diagnostics for that document. - final class DismissedNotifications extends AnyRef
-
final
class
Embedded extends Cancelable
Wrapper around software that is embedded with Metals.
Wrapper around software that is embedded with Metals.
- sbt-launch.jar - bloop.py - ch.epfl.scala:bloop-frontend
- sealed trait EmptyResult extends AnyRef
- final class FileEvents extends Cancelable
-
final
class
FileSystemSemanticdbs extends Semanticdbs
Reads SemanticDBs from disk that are produces by the semanticdb-scalac compiler plugin.
- final case class FileWatcherConfig(value: String) extends Product with Serializable
-
final
class
ForwardingMetalsBuildClient extends MetalsBuildClient
A build client that forwards notifications from the build server to the language client.
-
final
class
HtmlBuilder extends AnyRef
A string builder with helper methods for rendering HTML.
A string builder with helper methods for rendering HTML.
We don't use a library like Scalatags because we are trying to keep the number of external Scala dependencies low.
- abstract class Icons extends AnyRef
-
final
class
InteractiveSemanticdbs extends Cancelable with Semanticdbs
Produces SemanticDBs on-demand by using the presentation compiler.
Produces SemanticDBs on-demand by using the presentation compiler.
Only used to provide navigation inside external library sources, not used to compile workspace sources.
Uses persistent storage to keep track of what external source file is associated with what build target (to determine classpath and compiler options).
-
case class
MatchingToken(original: meta.Token, revised: meta.Token) extends Product with Serializable
A pair of tokens that align with each other across two different files
- class Messages extends AnyRef
-
trait
MetalsBuildClient extends AnyRef
A BSP client interface that uses lsp4j data structures where applicable.
A BSP client interface that uses lsp4j data structures where applicable.
Does not extend bsp4j BuildClient to avoid unnecessary converting between identical bsp/lsp data structures and also ignore unused endpoints like build/registerFileWatcher.
- trait MetalsBuildServer extends BuildServer with ScalaBuildServer
-
final
class
MetalsHttpClient extends MetalsLanguageClient
Editor client that implement dialogue UIs like window/showMessageRequest.
Editor client that implement dialogue UIs like window/showMessageRequest.
Goals:
- enable editor plugin authors access all functionality within Metals even if the editor plugin only supports a limited set of LSP endpoints.
Non-goals:
- Pretty UI, the interface only needs to be functional, not look nice. - Become permanent/primary interface for ordinary users. The end goal is to enable users to interact with Metals from their editor, not via a browser.
The most popular LSP clients in editors like Vim and Sublime currently have limited support so that endpoints like
window/showMessageRequestare ignored, with no workaround for users to interact with the Metals language server. This http client allows users in those editors to trigger server commands and respond to UI dialogues through their browser instead. -
final
class
MetalsHttpServer extends Cancelable
Http server
- trait MetalsLanguageClient extends LanguageClient
- class MetalsLanguageServer extends Cancelable
-
final
case class
MetalsServerConfig(bloopProtocol: BloopProtocol = BloopProtocol.default, fileWatcher: FileWatcherConfig = FileWatcherConfig.default, statusBar: StatusBarConfig = StatusBarConfig.default, slowTask: SlowTaskConfig = SlowTaskConfig.default, showMessage: ShowMessageConfig = ShowMessageConfig.default, showMessageRequest: ShowMessageRequestConfig = ShowMessageRequestConfig.default, isNoInitialized: Boolean = ..., isHttpEnabled: Boolean = ..., isVerbose: Boolean = ..., icons: Icons = Icons.default) extends Product with Serializable
Configuration parameters for the Metals language server.
Configuration parameters for the Metals language server.
- bloopProtocol
the protocol to communicate with Bloop.
- fileWatcher
whether to start an embedded file watcher in case the editor does not support file watching.
- statusBar
how to handle metals/status notifications.
- slowTask
how to handle metals/slowTask requests.
- showMessage
how to handle window/showMessage notifications.
- showMessageRequest
how to handle window/showMessageRequest requests.
- isNoInitialized
set true if the editor client doesn't call the
initializednotification for some reason, see https://github.com/natebosch/vim-lsc/issues/113- isHttpEnabled
whether to start the Metals HTTP client interface. This is needed for clients with limited support for UI dialogues like Sublime Text that don't implement window/showMessageRequest yet.
- icons
what icon set to use for messages.
- case class MetalsSlowTaskParams(message: String) extends Product with Serializable
- case class MetalsSlowTaskResult(cancel: Boolean) extends Product with Serializable
-
case class
MetalsStatusParams(text: String, show: java.lang.Boolean = null, hide: java.lang.Boolean = null, tooltip: String = null, command: String = null) extends Product with Serializable
Arguments for the metals/status notification.
Arguments for the metals/status notification.
- text
The text to display in the status bar.
- show
if true, show the status bar.
- hide
if true, hide the status bar.
- tooltip
optional display this message when the user hovers over the status bar item.
- command
optional command that the client should trigger when the user clicks on the status bar item.
-
final
class
MutableCancelable extends Cancelable
Open collection of cancelables that should cancel together
- final class MutableMd5Fingerprints extends Md5Fingerprints
- case class NonZeroExitCode(statusCode: Int) extends Exception with Product with Serializable
- abstract class ProgressTicks extends AnyRef
- case class SbtDigest(md5: String, status: Status, millis: Long) extends Product with Serializable
-
final
class
SbtDigests extends AnyRef
Wrapper around the sbt_digest sql table.
- final case class ShowMessageConfig(value: String) extends Product with Serializable
- final case class ShowMessageRequestConfig(value: String) extends Product with Serializable
- final case class SlowTaskConfig(value: String) extends Product with Serializable
-
final
class
StatusBar extends Cancelable
Manages sending metals/status notifications to the editor client.
Manages sending metals/status notifications to the editor client.
Some design constraints and design decisions: - we should publish no more than status update per second so the user has time to read the notification. - there is only one active status bar notification at each time, in case there are multiple candidates we pick the item with higher priority. - it's acceptable that a low priority notification may never appear in the status bar. - long-running jobs like compilation or "import workspace" are active as long as the attached
Future[_]is not completed. - final case class StatusBarConfig(value: String) extends Product with Serializable
- final class Tables extends Cancelable
-
trait
Time extends AnyRef
Wrapper around
System.nanoTimeto allow easier testing. - case class Timed[T](value: T, timer: Timer) extends Product with Serializable
- class Timer extends AnyRef
-
final
class
TokenEditDistance extends AnyRef
Helper to map between position between two similar strings.
-
case class
UserConfiguration(javaHome: Option[String] = None) extends Product with Serializable
Configuration that the user can override via workspace/didChangeConfiguration.
Configuration that the user can override via workspace/didChangeConfiguration.
- javaHome
The Java home location used to detect src.zip for JDK sources.
Value Members
- object BinarySearch
- object BloopInstall
- object BloopInstallResult extends Serializable
- object BloopProtocol extends Serializable
- object BloopServers
- object BloopSocket
- object BuildChange extends Serializable
-
object
BuildInfo extends Product with Serializable
This object was generated by sbt-buildinfo.
- object BuildServerConnection extends Serializable
- object BuildTool extends Serializable
- object Cancelable
-
object
ClientCommands
Optional commands that metals expects the client to implement.
- object Confirmation
-
object
Debug
Small utilities that are helpful for println debugging.
- object DefinitionResult extends Serializable
- object Directories
- object Embedded
- object EmptyResult
- object FileWatcherConfig extends Serializable
-
object
GlobalTrace
Manages JSON-RPC tracing of incoming/outgoing messages via BSP and LSP.
- object Icons
- object JdbcEnrichments
-
object
JdkSources
Locates zip file on disk that contains the source code for the JDK.
-
object
LanguageClientLogger extends Writer
Scribe logging handler that forwards logging messages to the LSP editor client.
-
object
Messages extends Messages
Constants for requests/dialogues via LSP window/showMessage and window/showMessageRequest.
-
object
MetalsEnrichments extends DecorateAsJava with DecorateAsScala
One stop shop for all extension methods that are used in the metals build.
One stop shop for all extension methods that are used in the metals build.
Usage:
import scala.meta.internal.metals.MetalsEnrichments._ List(1).asJava Future(1).asJava // ...
Includes the following converters from the standard library:
import scala.compat.java8.FutureConverters._ import scala.collection.JavaConverters._
If this doesn't scale because we have too many unrelated extension methods then we can split this up, but for now it's really convenient to have to remember only one import.
- object MetalsHttpServer
- object MetalsLogger
- object MetalsServerConfig extends Serializable
-
object
NoopLanguageClient extends MetalsLanguageClient
A language client that ignores all requests.
A language client that ignores all requests.
Used during shutdown procedure to ensure no status bar updates or log messages are published during shutdown.
- object PositionSyntax
- object ProgressTicks
- object SbtDigest extends Serializable
- object SbtVersion
-
object
ServerCommands
LSP commands supported by the Metals language server.
- object ShowMessageConfig extends Serializable
- object ShowMessageRequestConfig extends Serializable
- object SlowTaskConfig extends Serializable
- object StatusBarConfig extends Serializable
- object Tables
- object Time
- object Timed extends Serializable
- object Timer
- object TokenEditDistance
- object Urls
- object UserConfiguration extends Serializable