package metals

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. 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.

  2. final case class AggregateSemanticdbs(underlying: List[Semanticdbs]) extends Semanticdbs with Product with Serializable

    Implements TextDocuments trait with a list of underlying implementations.

  3. 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.

  4. final class BloopInstall extends Cancelable

    Runs sbt bloopInstall processes.

    Runs sbt bloopInstall processes.

    Handles responsibilities like: - install metals.sbt as a global sbt plugin - launching embedded sbt-launch.jar via system process - reporting client about sbt bloopInstall progress

  5. sealed abstract class BloopInstallResult extends Product with Serializable
  6. final case class BloopProtocol(value: String) extends Product with Serializable
  7. 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

  8. 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.

  9. 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.

  10. sealed abstract class BuildChange extends Product with Serializable
  11. 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.

  12. class BuildServerInitializeException extends Exception
  13. final class BuildTargets extends AnyRef

    In-memory cache for looking up build server metadata.

  14. sealed abstract class BuildTool extends Product with Serializable
  15. 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".

  16. trait Cancelable extends AnyRef

    A copy of java.io.Closeable that is not auto closeable.

    A copy of java.io.Closeable that is not auto closeable.

    Gives us fine-grained control over when resources are cleaned up.

  17. case class Command(id: String, title: String, description: String) extends Product with Serializable
  18. 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.

  19. sealed abstract class Confirmation extends AnyRef
  20. 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

  21. case class DefinitionResult(locations: java.util.List[Location], symbol: String, definition: Option[io.AbsolutePath], semanticdb: Option[TextDocument]) extends Product with Serializable
  22. final class DependencySources extends AnyRef
  23. 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/publishDiagnostics notifications. - LSP requires that the last textDocument/publishDiagnostics notification includes all active diagnostics for that document.

  24. final class DismissedNotifications extends AnyRef
  25. 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

  26. sealed trait EmptyResult extends AnyRef
  27. final class FileEvents extends Cancelable
  28. final class FileSystemSemanticdbs extends Semanticdbs

    Reads SemanticDBs from disk that are produces by the semanticdb-scalac compiler plugin.

  29. final case class FileWatcherConfig(value: String) extends Product with Serializable
  30. final class ForwardingMetalsBuildClient extends MetalsBuildClient

    A build client that forwards notifications from the build server to the language client.

  31. 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.

  32. abstract class Icons extends AnyRef
  33. 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).

  34. 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

  35. class Messages extends AnyRef
  36. 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.

  37. trait MetalsBuildServer extends BuildServer with ScalaBuildServer
  38. 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/showMessageRequest are 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.

  39. final class MetalsHttpServer extends Cancelable

    Http server

  40. trait MetalsLanguageClient extends LanguageClient
  41. class MetalsLanguageServer extends Cancelable
  42. 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 initialized notification 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.

  43. case class MetalsSlowTaskParams(message: String) extends Product with Serializable
  44. case class MetalsSlowTaskResult(cancel: Boolean) extends Product with Serializable
  45. 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.

  46. final class MutableCancelable extends Cancelable

    Open collection of cancelables that should cancel together

  47. final class MutableMd5Fingerprints extends Md5Fingerprints
  48. case class NonZeroExitCode(statusCode: Int) extends Exception with Product with Serializable
  49. abstract class ProgressTicks extends AnyRef
  50. case class SbtDigest(md5: String, status: Status, millis: Long) extends Product with Serializable
  51. final class SbtDigests extends AnyRef

    Wrapper around the sbt_digest sql table.

  52. final case class ShowMessageConfig(value: String) extends Product with Serializable
  53. final case class ShowMessageRequestConfig(value: String) extends Product with Serializable
  54. final case class SlowTaskConfig(value: String) extends Product with Serializable
  55. 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.

  56. final case class StatusBarConfig(value: String) extends Product with Serializable
  57. final class Tables extends Cancelable
  58. trait Time extends AnyRef

    Wrapper around System.nanoTime to allow easier testing.

  59. case class Timed[T](value: T, timer: Timer) extends Product with Serializable
  60. class Timer extends AnyRef
  61. final class TokenEditDistance extends AnyRef

    Helper to map between position between two similar strings.

  62. 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

  1. object BinarySearch
  2. object BloopInstall
  3. object BloopInstallResult extends Serializable
  4. object BloopProtocol extends Serializable
  5. object BloopServers
  6. object BloopSocket
  7. object BuildChange extends Serializable
  8. object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  9. object BuildServerConnection extends Serializable
  10. object BuildTool extends Serializable
  11. object Cancelable
  12. object ClientCommands

    Optional commands that metals expects the client to implement.

  13. object Confirmation
  14. object Debug

    Small utilities that are helpful for println debugging.

  15. object DefinitionResult extends Serializable
  16. object Directories
  17. object Embedded
  18. object EmptyResult
  19. object FileWatcherConfig extends Serializable
  20. object GlobalTrace

    Manages JSON-RPC tracing of incoming/outgoing messages via BSP and LSP.

  21. object Icons
  22. object JdbcEnrichments
  23. object JdkSources

    Locates zip file on disk that contains the source code for the JDK.

  24. object LanguageClientLogger extends Writer

    Scribe logging handler that forwards logging messages to the LSP editor client.

  25. object Messages extends Messages

    Constants for requests/dialogues via LSP window/showMessage and window/showMessageRequest.

  26. 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.

  27. object MetalsHttpServer
  28. object MetalsLogger
  29. object MetalsServerConfig extends Serializable
  30. 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.

  31. object PositionSyntax
  32. object ProgressTicks
  33. object SbtDigest extends Serializable
  34. object SbtVersion
  35. object ServerCommands

    LSP commands supported by the Metals language server.

  36. object ShowMessageConfig extends Serializable
  37. object ShowMessageRequestConfig extends Serializable
  38. object SlowTaskConfig extends Serializable
  39. object StatusBarConfig extends Serializable
  40. object Tables
  41. object Time
  42. object Timed extends Serializable
  43. object Timer
  44. object TokenEditDistance
  45. object Urls
  46. object UserConfiguration extends Serializable

Ungrouped