Packages

package metals

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package ammonite
  2. package callHierarchy
  3. package clients
  4. package codeactions
  5. package codelenses
  6. package config
  7. package data
  8. package debug
  9. package doctor
  10. package findfiles
  11. package formatting
  12. package logging
  13. package newScalaFile
  14. package scalacli
  15. package testProvider
  16. package utils
  17. package watcher

Type Members

  1. final case class AbsoluteDir(value: io.AbsolutePath) extends AnyVal with Product with Serializable
  2. final case class AbsoluteFile(value: io.AbsolutePath) extends AnyVal with Product with Serializable
  3. 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.

  4. trait AdjustLspData extends AnyRef
  5. case class AdjustedLspData(adjustPosition: (org.eclipse.lsp4j.Position) => org.eclipse.lsp4j.Position, filterOutLocations: (Location) => Boolean) extends AdjustLspData with Product with Serializable
  6. final case class AggregateSemanticdbs(underlying: List[Semanticdbs]) extends Semanticdbs with Product with Serializable

    Implements TextDocuments trait with a list of underlying implementations.

  7. sealed trait AutoImportBuildKind extends AnyRef
  8. sealed trait BaseCommand extends AnyRef
  9. final class BatchedFunction[A, B] extends (Seq[A]) => Future[B] with (Seq[A], () => Unit) => Future[B] with Pauseable

    Helper to batch multiple asynchronous requests and ensure only one request is active at a time.

  10. final class BloopServers extends AnyRef

    Establishes a connection with a bloop server using Bloop Launcher.

    Establishes a connection with a bloop server using Bloop Launcher.

    Connects to a running bloop server instance if it is installed on the user machine and starts a new one if it isn't. Alternatively user can use the coursier command to launch it:

    coursier launch ch.epfl.scala:bloopgun-core_2.12:{bloop-version} -- about

    Eventually, this class may be superseded by "BSP connection protocol": https://build-server-protocol.github.io/docs/server-discovery.html

  11. class BspStatus extends AnyRef
  12. 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.

  13. class BuildServerConnection extends Cancelable

    An actively running and initialized BSP connection

  14. class BuildServerInitializeException extends Exception
  15. class BuildTargetInfo extends AnyRef
  16. final class BuildTargets extends AnyRef

    In-memory cache for looking up build server metadata.

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

  18. case class CancelableFuture[T](future: Future[T], cancelable: Cancelable = Cancelable.empty) extends Cancelable with Product with Serializable
  19. class ChosenBuildServers extends AnyRef
  20. class ChosenBuildTool extends AnyRef
  21. final class ClientConfiguration extends AnyRef

    This class provides a uniform way to know how the client is configured using a combination of server properties, clientExperimentalCapabilities and initializationOptions.

  22. final case class ClientExperimentalCapabilities(debuggingProvider: Option[Boolean], decorationProvider: Option[Boolean], didFocusProvider: Option[Boolean], doctorProvider: Option[String], executeClientCommandProvider: Option[Boolean], inputBoxProvider: Option[Boolean], openFilesOnRenameProvider: Option[Boolean], quickPickProvider: Option[Boolean], statusBarProvider: Option[String], treeViewProvider: Option[Boolean]) extends Product with Serializable

    While all these values can be set here, they are here only for compatibility with clients that were setting them this way.

    While all these values can be set here, they are here only for compatibility with clients that were setting them this way. From a client perspective it's preferable and recommended to use InitializationOptions instead. From a development perspective don't add something here unless it's truly a more "experimental" type feature.

  23. class ClosableOutputStream extends FilterOutputStream
  24. final class CodeLensProvider extends AnyRef
  25. case class Command(id: String, title: String, description: String, arguments: String = "`null`") extends BaseCommand with Product with Serializable
  26. sealed trait CommandHTMLFormat extends AnyRef
  27. final class Compilations extends AnyRef
  28. class CompilerConfiguration extends AnyRef
  29. class CompilerPlugins extends AnyRef

    Responsible for disabling unsupported compiler plugins.

    Responsible for disabling unsupported compiler plugins.

    Metals only uses the presentation compiler for limited features - completions - hover - parameter hints Compiler plugins that don't affect those features can be disabled, for example WartRemover that only reports diagnostics. Diagnostics are already published from the build, where all compiler plugins are enabled by default.

    Some compiler plugins change the semantics of the Scala language. Metals officially only supports a hardcoded list of such compiler plugins: - kind-projector, introduces new syntax for anonymous type lambdas - better-monadic-for, changes for comprehension desugaring The IntelliJ Scala plugin has custom support for these plugins.

    Notably, macro-paradise-plugin id disabled because it does not work with the -Ymacro-expand:discard setting making completions always fail when inside an expanded tree.

    The process for adding support for other compiler plugins is the following, send a PR to Metals adding integration tests to demonstrate thee compiler plugin - needs to be enabled in order for completions/hover to function. Many plugins like WartRemover that only use the compiler report don't need to be enabled. - enabling the plugin does not break the presentation compiler in unexpected ways.

  30. class Compilers extends Cancelable

    Manages lifecycle for presentation compilers in all build targets.

    Manages lifecycle for presentation compilers in all build targets.

    We need a custom presentation compiler for each build target since build targets can have different classpaths and compiler settings.

  31. sealed abstract class Confirmation extends AnyRef
  32. case class ContextSymbols(enclosingPackagePath: Option[String], enclosingSymbol: Option[String], alternativeEnclosingSymbol: Option[String]) extends Product with Serializable
  33. case class DebugDiscoveryParams(path: String, runType: String, args: java.util.List[String] = null, jvmOptions: java.util.List[String] = null, env: Map[String, String] = null, envFile: String = null) extends Product with Serializable
  34. final case class DebugSession(name: String, uri: String) extends Product with Serializable
  35. case class DebugUnresolvedAttachRemoteParams(hostName: String, port: Int, buildTarget: String) extends Product with Serializable
  36. case class DebugUnresolvedMainClassParams(mainClass: String, buildTarget: String = null, args: java.util.List[String] = null, jvmOptions: java.util.List[String] = null, env: Map[String, String] = null, envFile: String = null) extends Product with Serializable
  37. case class DebugUnresolvedTestClassParams(testClass: String, buildTarget: String = null, jvmOptions: java.util.List[String] = null, env: Map[String, String] = null, envFile: String = null) extends Product with Serializable
  38. final case class DecoderResponse(requestedUri: String, value: String, error: String) extends Product with Serializable
  39. case class DefinitionDestination(snapshot: TextDocument, distance: TokenEditDistance, symbol: String, path: Option[io.AbsolutePath], uri: String, querySymbol: String) extends Product with Serializable
  40. 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

  41. case class DefinitionResult(locations: java.util.List[Location], symbol: String, definition: Option[io.AbsolutePath], semanticdb: Option[TextDocument], querySymbol: String) extends Product with Serializable
  42. final class DependencySources extends AnyRef
  43. class DestinationProvider extends AnyRef
  44. final class Diagnostics extends AnyRef

    Converts diagnostics from the build server and Scalameta parser into LSP diagnostics.

    Converts diagnostics from the build server and Scalameta parser into LSP diagnostics.

    BSP diagnostics have different semantics from LSP diagnostics with regards to how they are published. BSP diagnostics can be accumulated when reset=false, meaning the client (Metals) is responsible for aggregating multiple build/publishDiagnostics notifications into a single textDocument/publishDiagnostics notification.

    Another challenge is to consolidate syntax errors on every keystroke with type errors on batch compile because positions get stale in batch compile errors as you type new syntax errors. To solve this problem we use token edit distance the same way we support goto definition in stale buffers.

  45. final class DismissedNotifications extends AnyRef
  46. final case class DocumentSymbolConfig(value: String) extends Product with Serializable
  47. final class Embedded extends Cancelable

    Wrapper around software that is embedded with Metals.

    Wrapper around software that is embedded with Metals.

    - sbt-launch.jar - mdoc

  48. final case class ExecuteClientCommandConfig(value: String) extends Product with Serializable
  49. class FallbackMetalsLspService extends MetalsLspService
  50. final class FileDecoderProvider extends AnyRef
  51. final class FileSystemSemanticdbs extends Semanticdbs

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

  52. case class FileToZip(name: String, text: Array[Byte]) extends Product with Serializable
  53. case class Fingerprint(text: String, md5: String) extends Product with Serializable
  54. final class Fingerprints extends AnyRef

    Wrapper around the fingerprints sql table.

    Wrapper around the fingerprints sql table.

    It's needed to save the last known state of the workspace files to calculate differences between current state and semanticdb view of the file.

    We need to save it between restarts in case user reloaded a workspace with errors.

  55. class Folder extends AnyRef
  56. case class FolderReportsZippper(doctorTargetsInfo: () => List[Map[String, String]], reportContext: StdReportContext) extends Product with Serializable
  57. final class FormattingProvider extends Cancelable

    Implement text formatting using Scalafmt

  58. case class FutureCancelToken(f: Future[Boolean])(implicit ec: ExecutionContext) extends CancelToken with Product with Serializable

    A cancel token backed by a Scala future.

  59. case class GitHubIssueFolderInfo(selectedBuildTool: () => Option[String], buildTargets: BuildTargets, currentBuildServer: () => Option[BspSession], calculateNewBuildServer: () => BspResolvedResult, buildTools: BuildTools) extends Product with Serializable
  60. class GithubNewIssueUrlCreator extends AnyRef
  61. case class HoverExtParams(textDocument: TextDocumentIdentifier, position: org.eclipse.lsp4j.Position = null, range: org.eclipse.lsp4j.Range = null) extends Product with Serializable
  62. abstract class Icons extends AnyRef
  63. case class ImportEdits[+R](handledRefs: List[R], edits: List[TextEdit]) extends Product with Serializable
  64. case class ImportedBuild(workspaceBuildTargets: WorkspaceBuildTargetsResult, scalacOptions: ScalacOptionsResult, javacOptions: JavacOptionsResult, sources: SourcesResult, dependencySources: DependencySourcesResult, wrappedSources: WrappedSourcesResult, dependencyModules: DependencyModulesResult) extends Product with Serializable

    Metadata that we import from the build tool via BSP.

  65. class ImporterRenamer extends AnyRef
  66. final case class Indexer(workspaceReload: () => WorkspaceReload, doctorCheck: () => Unit, languageClient: DelegatingLanguageClient, bspSession: () => Option[BspSession], executionContext: ExecutionContextExecutorService, tables: Tables, statusBar: () => StatusBar, workDoneProgress: WorkDoneProgress, timerProvider: TimerProvider, scalafixProvider: () => ScalafixProvider, indexingPromise: () => Promise[Unit], buildData: () => Seq[BuildTool], clientConfig: ClientConfiguration, definitionIndex: OnDemandSymbolIndex, referencesProvider: () => ReferenceProvider, workspaceSymbols: () => WorkspaceSymbolProvider, buildTargets: BuildTargets, interactiveSemanticdbs: () => InteractiveSemanticdbs, buildClient: () => ForwardingMetalsBuildClient, semanticDBIndexer: () => SemanticdbIndexer, treeView: () => FolderTreeViewProvider, worksheetProvider: () => WorksheetProvider, symbolSearch: () => MetalsSymbolSearch, buildTools: () => BuildTools, formattingProvider: () => FormattingProvider, fileWatcher: FileWatcher, focusedDocument: () => Option[io.AbsolutePath], focusedDocumentBuildTarget: AtomicReference[BuildTargetIdentifier], buildTargetClasses: BuildTargetClasses, userConfig: () => UserConfiguration, sh: ScheduledExecutorService, symbolDocs: Docstrings, scalaVersionSelector: ScalaVersionSelector, sourceMapper: SourceMapper, workspaceFolder: io.AbsolutePath, implementationProvider: ImplementationProvider, isConnecting: () => Boolean)(implicit rc: ReportContext) extends Product with Serializable

    Coordinates build target data fetching and caching, and the re-computation of various indexes based on it.

  67. final case class InitializationOptions(compilerOptions: CompilerInitializationOptions, debuggingProvider: Option[Boolean], runProvider: Option[Boolean], decorationProvider: Option[Boolean], inlineDecorationProvider: Option[Boolean], didFocusProvider: Option[Boolean], doctorProvider: Option[String], executeClientCommandProvider: Option[Boolean], globSyntax: Option[String], icons: Option[String], inputBoxProvider: Option[Boolean], isExitOnShutdown: Option[Boolean], isHttpEnabled: Option[Boolean], commandInHtmlFormat: Option[CommandHTMLFormat], isVirtualDocumentSupported: Option[Boolean], openFilesOnRenameProvider: Option[Boolean], quickPickProvider: Option[Boolean], renameFileThreshold: Option[Int], statusBarProvider: Option[String], treeViewProvider: Option[Boolean], testExplorerProvider: Option[Boolean], openNewWindowProvider: Option[Boolean], copyWorksheetOutputProvider: Option[Boolean], disableColorOutput: Option[Boolean], doctorVisibilityProvider: Option[Boolean], bspStatusBarProvider: Option[String]) extends Product with Serializable

    This is the preferred way to configure Metals from the client.

    This is the preferred way to configure Metals from the client. Eventually this will be accumulated in the ClientConfiguration along with ClientExperimentalCapabilities and the InitialConfig. If the values aren't directly passed in here, we default everything to None to signify that the client didn't directly set the value. The defaults will then be handled by the ClientConfiguration so we don't need to worry about them here.

    compilerOptions

    configuration for the PresentationCompilerConfig.

    debuggingProvider

    if the client supports debugging.

    decorationProvider

    if the client implements the Metals Decoration Protocol.

    inlineDecorationProvider

    if the client implements the Metals Decoration Protocol and supports decorations to be shown inline and not only at the end of a line.

    didFocusProvider

    if the client implements the metals/didFocusTextDocument command.

    doctorProvider

    format that the client would like the Doctor to be returned in.

    executeClientCommandProvider

    if the client implements metals/executeClientCommand.

    globSyntax

    pattern used for DidChangeWatchedFilesRegistrationOptions.

    icons

    which icons will be used for messages.

    inputBoxProvider

    if the client implements metals/inputBox.

    isExitOnShutdown

    whether the client needs Metals to shut down manually on exit.

    isHttpEnabled

    whether the client needs Metals to start an HTTP client interface.

    isVirtualDocumentSupported

    whether the client supports VirtualDocuments. For opening source jars in read-only * https://code.visualstudio.com/api/extension-guides/virtual-documents

    openFilesOnRenameProvider

    whether or not the client supports opening files on rename.

    quickPickProvider

    if the client implements metals/quickPick.

    renameFileThreshold

    amount of files that should be opened during rename if client is a openFilesOnRenameProvider.

    statusBarProvider

    if the client implements metals/status.

    treeViewProvider

    if the client implements the Metals Tree View Protocol.

    testExplorerProvider

    if the client implements the Test Explorer UI.

    openNewWindowProvider

    if the client can open a new window after new project creation.

    copyWorksheetOutputProvider

    if the client can execute server CopyWorksheet command and copy results to the local buffer.

    disableColorOutput

    in the situation where your DAP client may not handle color codes in the output, you can enable this to strip them.

    doctorVisibilityProvider

    if the clients implements metals/doctorVisibilityDidChange

    bspStatusBarProvider

    if the client supports metals/status with "bsp" status type

  68. final class InlayHintResolveProvider extends AnyRef
  69. sealed trait InlayHintsOption extends AnyRef
  70. final case class InlayHintsOptions(options: Map[InlayHintsOption, Boolean]) extends AnyVal with Product with Serializable
  71. 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).

  72. final class JarTopLevels extends AnyRef

    Handles caching of Jar Top Level Symbols in H2

    Handles caching of Jar Top Level Symbols in H2

    Wrapper around the indexed_jar and toplevel_symbol sql tables.

  73. final class JavaDocumentHighlightProvider extends AnyRef
  74. case class JavaFormatConfig(eclipseFormatConfigPath: io.AbsolutePath, eclipseFormatProfile: Option[String]) extends Product with Serializable
  75. final class JavaFormattingProvider extends AnyRef
  76. class JavaInteractiveSemanticdb extends AnyRef
  77. case class JavaTarget(info: BuildTarget, javac: JavacOptionsItem, bspConnection: Option[BuildServerConnection]) extends JvmTarget with Product with Serializable
  78. case class JdkVersion(major: Int, full: String) extends Product with Serializable
  79. trait JvmTarget extends AnyRef
  80. case class ListParametrizedCommand[T](id: String, title: String, description: String, arguments: String)(implicit evidence$2: ClassTag[T]) extends BaseCommand with Product with Serializable
  81. final class MetalsBspException extends Exception
  82. 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.

  83. trait MetalsBuildServer extends BuildServer with ScalaBuildServer with JavaBuildServer with JvmBuildServer with ScalaScriptBuildServer
  84. case class MetalsExperimental(rangeHoverProvider: Boolean = true) extends Product with Serializable

    Language Server Protocol extensions that are declared as "server capabilities" in the initialize response.

  85. final class MetalsHttpClient extends DelegatingLanguageClient

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

  86. final class MetalsHttpServer extends Cancelable

    Http server

  87. class MetalsLspService extends Folder with Cancelable with TextDocumentService

    Metals implementation of the Scala Language Service.

  88. final case class MetalsServerConfig(globSyntax: GlobSyntaxConfig = GlobSyntaxConfig.default, statusBar: StatusBarConfig = StatusBarConfig.default, bspStatusBar: StatusBarConfig = StatusBarConfig.bspDefault, executeClientCommand: ExecuteClientCommandConfig = ExecuteClientCommandConfig.default, snippetAutoIndent: Boolean = MetalsServerConfig.binaryOption( "metals.snippet-auto-indent", default = true, ), isExitOnShutdown: Boolean = MetalsServerConfig.binaryOption( "metals.exit-on-shutdown", default = false, ), isHttpEnabled: Boolean = MetalsServerConfig.binaryOption( "metals.http", default = false, ), isInputBoxEnabled: Boolean = MetalsServerConfig.binaryOption( "metals.input-box", default = false, ), isVerbose: Boolean = MetalsServerConfig.binaryOption( "metals.verbose", default = false, ), openFilesOnRenames: Boolean = false, renameFileThreshold: Int = 300, askToReconnect: Boolean = MetalsServerConfig.binaryOption( "metals.ask-to-reconnect", default = false, ), icons: Icons = Icons.fromString(System.getProperty("metals.icons")), statistics: StatisticsConfig = StatisticsConfig.default, compilers: PresentationCompilerConfigImpl = CompilersConfig(), allowMultilineStringFormatting: Boolean = MetalsServerConfig.binaryOption( "metals.allow-multiline-string-formatting", default = true, ), bloopPort: Option[Int] = Option(System.getProperty("metals.bloop-port")) .filter(_.forall(Character.isDigit(_))) .map(_.toInt), macOsMaxWatchRoots: Int = Option(System.getProperty("metals.macos-max-watch-roots")) .filter(_.forall(Character.isDigit(_))) .map(_.toInt) .getOrElse(32), loglevel: String = sys.props.get("metals.loglevel").map(_.toLowerCase()).getOrElse("info"), maxLogFileSize: Long = Option(System.getProperty("metals.max-logfile-size")) .withFilter(_.forall(Character.isDigit(_))) .map(_.toLong) .getOrElse(3 << 20), maxLogBackups: Int = Option(System.getProperty("metals.max-log-backups")) .withFilter(_.forall(Character.isDigit(_))) .map(_.toInt) .getOrElse(10), metalsToIdleTime: Duration = Option(System.getProperty("metals.server-to-idle-time")) .flatMap(opt => Try(Duration(opt)).toOption) .getOrElse(Duration("10m")), pingInterval: Duration = Option(System.getProperty("metals.build-server-ping-interval")) .flatMap(opt => Try(Duration(opt)).toOption) .getOrElse(Duration("1m")), worksheetTimeout: Int = Option(System.getProperty("metals.worksheet-timeout")) .filter(_.forall(Character.isDigit(_))) .map(_.toInt) .getOrElse(30)) extends Product with Serializable

    Configuration parameters for the Metals language server.

    Configuration parameters for the Metals language server. While these can be used to configure Metals, it's preferable that instead you configure Metals via InitializationOptions.

    globSyntax

    pattern used for DidChangeWatchedFilesRegistrationOptions.

    statusBar

    how to handle metals/status notifications with {"statusType": "metals"}.

    bspStatusBar

    how to handle metals/status notifications with {"statusType": "bsp"}.

    executeClientCommand

    whether client provides the ability to support the metals/executeClientCommand command.

    snippetAutoIndent

    if the client defaults to adding the identation of the reference line that the operation started on (relevant for multiline textEdits)

    isExitOnShutdown

    whether the client needs Metals to shut down manually on exit.

    isHttpEnabled

    whether to start the Metals HTTP client interface. This is needed for clients with limited support for UI dialogues that don't implement window/showMessageRequest yet.

    isInputBoxEnabled

    whether the client supports the metals/inputBox extension.

    isVerbose

    turn on verbose logging.

    openFilesOnRenames

    whether or not file should be opened when a rename occurs in an unopened file.

    renameFileThreshold

    amount of files that should be opened during a rename if the openFilesOnRenames is enabled.

    askToReconnect

    whether the user should be prompted to reconnect after a BuildServer connection is lost.

    icons

    what icon set to use for messages.

    statistics

    if all statistics in Metals should be enabled.

    compilers

    configuration for the PresentationCompilerConfig.

    allowMultilineStringFormatting

    whether or not multilineStringFormatting should be turned off. By default this is on, but Metals only supports a small subset of this, so it may be problematic for certain clients.

    macOsMaxWatchRoots

    The maximum number of root directories to watch on MacOS.

    maxLogFileSize

    The maximum size of the log file before it gets backed up and truncated.

    maxLogBackups

    The maximum number of backup log files.

    metalsToIdleTime

    The time that needs to pass with no action to consider metals as idle.

    pingInterval

    Interval in which we ping the build server.

  89. final case class MetalsServerInputs(buffers: Buffers, time: Time, initialServerConfig: MetalsServerConfig, initialUserConfig: UserConfiguration, bspGlobalDirectories: List[io.AbsolutePath], mtagsResolver: MtagsResolver, onStartCompilation: () => Unit, redirectSystemOut: Boolean, progressTicks: ProgressTicks, isReliableFileWatcher: Boolean, classpathSearchIndexer: ClasspathSearch.Indexer, charset: Charset) extends Product with Serializable

    Container class for metals language server and service configuration.

    Container class for metals language server and service configuration. The configuration is mostly used to allow for custom behaviour in tests. All the defaults are the instances used on the production.

    buffers

    In-memory text contents for unsaved files.

    time

    A "clock" instance for getting the current time.

    initialServerConfig

    Configuration parameters for the Metals language server.

    initialUserConfig

    Configuration which can be overriden by the user (via workspace/didChangeConfiguration)

    bspGlobalDirectories

    Directories for user and system installed BSP connection details according to BSP spec: https://build-server-protocol.github.io/docs/server-discovery.html#default-locations-for-bsp-connection-files

    mtagsResolver

    Mtags provider.

    onStartCompilation

    A function executed on comilation start. Used in tests to e.g. count the number of executed compilations.

    redirectSystemOut

    If system.out should be redirected into a file.

    progressTicks

    Tick marks kind for progress bars.

    isReliableFileWatcher

    A special flag set to false only when running tests on non-Linux computers to avoid flaky-test failure delayed file watching notifications

    classpathSearchIndexer

    Indexer for classpath elements for workspace symbol search.

    charset

    The mapping between sequences of sixteen-bit Unicode codes and sequences of bytes that should be used for interpreting the files.

  90. class MetalsSymbolSearch extends SymbolSearch

    Implementation of SymbolSearch that delegates to WorkspaceSymbolProvider and SymbolDocumentationIndexer.

  91. case class MethodSymbol(prefixSymbol: String) extends ScalaDocLinkSymbol with Product with Serializable
  92. sealed trait MtagsBinaries extends AnyRef
  93. trait MtagsResolver extends AnyRef
  94. final class MutableCancelable extends Cancelable

    Open collection of cancelables that should cancel together

  95. final class MutableMd5Fingerprints extends Md5Fingerprints
  96. case class NonZeroExitCode(statusCode: Int) extends Exception with Product with Serializable
  97. case class OpenBrowserCommand(url: String, title: String, description: String) extends BaseCommand with Product with Serializable
  98. class PackageObject extends AnyRef
  99. case class PackagePartsRenamer(oldPackageParts: List[String], newPackageParts: List[String]) extends Product with Serializable

    Rename for an importer.

    Rename for an importer.

    E.g. file://root/a/b/d/e/File.scala package a.b package d.e

    object SomeObject { } Gets moved to file://root/a/b/c/File.scala. In file with reference: package a.b import a.b.d.e.SomeObject

    val m = d.e.SomeObject We will rename: - a.b.d.e.SomeObject -> a.b.c.SomeObject which corresponds to PackagePartsRenamer(List("a", "b", "d", "e"), List("a", "b", "c")) - d.e.SomeObject -> c.SomeObject which corresponds to PackagePartsRenamer(List("d", "e"), List("c"))

  100. class PackageProvider extends AnyRef
  101. case class ParametrizedCommand[T](id: String, title: String, description: String, arguments: String)(implicit evidence$1: ClassTag[T]) extends BaseCommand with Product with Serializable
  102. sealed trait PathMatcher extends AnyRef
  103. trait Pauseable extends AnyRef

    Interface for something that can be paused and unpaused, for example a stream of compile requests.

  104. class PopupChoiceReset extends AnyRef
  105. class PresentationCompilerClassLoader extends ClassLoader

    ClassLoader that is used to reflectively invoke presentation compiler APIs.

    ClassLoader that is used to reflectively invoke presentation compiler APIs.

    The presentation compiler APIs are compiled against exact Scala versions of the compiler while Metals only runs in a single Scala version. In order to communicate between Metals and the reflectively loaded compiler, this classloader shares a subset of Java classes that appear in method signatures of the PresentationCompiler class.

  106. abstract class ProgressTicks extends AnyRef
  107. class QuietInputStream extends FilterInputStream

    A delegate input stream that gracefully fails when the underlying stream is closed.

    A delegate input stream that gracefully fails when the underlying stream is closed.

    This class exists to suppress lsp4j logs like this:

      WARNING: Failed to send notification message.
    org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.io.IOException: Stream Closed
     at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:72)
     at org.eclipse.lsp4j.jsonrpc.Launcher$Builder.lambda$wrapMessageConsumer$0(Launcher.java:312)
     at or
  108. case class Reference(definition: TopLevelDeclaration, pos: org.eclipse.lsp4j.Range, uri: String) extends Product with Serializable
  109. final class ReferenceProvider extends SemanticdbFeatureProvider
  110. case class ReferencesResult(symbol: String, locations: Seq[Location]) extends Product with Serializable
  111. trait RequestMonitor extends AnyRef
  112. class RequestMonitorImpl extends RequestMonitor
  113. case class ResolvedSymbolOccurrence(distance: TokenEditDistance, occurrence: Option[SymbolOccurrence]) extends Product with Serializable

    A symbol occurrence that appeared with the given edit distance

  114. case class RunScalafixRulesParams(textDocumentPositionParams: TextDocumentPositionParams, rules: java.util.List[String] = null) extends Product with Serializable
  115. case class ScalaDocLink(rawSymbol: String, isScala3: Boolean) extends Product with Serializable
  116. sealed trait ScalaDocLinkSymbol extends AnyRef
  117. case class ScalaTarget(info: BuildTarget, scalaInfo: ScalaBuildTarget, scalac: ScalacOptionsItem, autoImports: Option[Seq[String]], sbtVersion: Option[String], bspConnection: Option[BuildServerConnection]) extends JvmTarget with Product with Serializable
  118. final case class ScalaTestSuiteSelection(className: String, tests: java.util.List[String]) extends Product with Serializable
  119. final case class ScalaTestSuites(suites: java.util.List[ScalaTestSuiteSelection], jvmOptions: java.util.List[String], environmentVariables: java.util.List[String]) extends Product with Serializable
  120. final case class ScalaTestSuitesDebugRequest(target: BuildTargetIdentifier, requestData: ScalaTestSuites) extends Product with Serializable
  121. class ScalaVersionSelector extends AnyRef
  122. class ScalaVersions extends AnyRef
  123. class ScaladocDefinitionProvider extends AnyRef
  124. case class ScalafixProvider(buffers: Buffers, userConfig: () => UserConfiguration, workspace: io.AbsolutePath, workDoneProgress: WorkDoneProgress, compilations: Compilations, languageClient: MetalsLanguageClient, buildTargets: BuildTargets, buildClient: MetalsBuildClient, interactive: InteractiveSemanticdbs)(implicit ec: ExecutionContext) extends Product with Serializable
  125. case class ScalafmtConfig(version: Option[Version], runnerDialect: Option[ScalafmtDialect], fileOverrides: List[(PathMatcher, ScalafmtDialect)], includeFilters: List[PathMatcher], excludeFilters: List[PathMatcher]) extends Product with Serializable

    A partial representation of scalafmt config format.

    A partial representation of scalafmt config format. Includes only settings that affect dialect.

  126. sealed abstract class ScalafmtDialect extends AnyRef
  127. trait SemanticdbFeatureProvider extends AnyRef
  128. class SemanticdbIndexer extends AnyRef
  129. class ServerLivenessMonitor extends AnyRef
  130. case class SocketConnection(serverName: String, output: ClosableOutputStream, input: InputStream, cancelables: List[Cancelable], finishedPromise: Promise[Unit]) extends Product with Serializable
  131. final case class SourceMapper(buildTargets: BuildTargets, buffers: Buffers) extends Product with Serializable
  132. class StacktraceAnalyzer extends AnyRef
  133. class StandaloneSymbolSearch extends SymbolSearch
  134. final case class StatisticsConfig(value: String) extends Product with Serializable
  135. 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.

  136. final case class StatusBarConfig(value: String) extends Product with Serializable
  137. case class StringSymbol(symbol: String) extends ScalaDocLinkSymbol with Product with Serializable
  138. class SymbolAlternatives extends AnyRef
  139. final class Tables extends Cancelable
  140. final class TargetData extends AnyRef
  141. class TaskProgress extends AnyRef

    Denotes how much of a task has been completed.

  142. sealed trait TestUserInterfaceKind extends AnyRef
  143. trait Time extends AnyRef

    Wrapper around System.nanoTime and System.currentTimeMillis to allow easier testing.

  144. class Timer extends AnyRef
  145. final class TimerProvider extends AnyRef

    Helper class to provider functionality around timers.

  146. case class TopLevelDeclaration(name: String, innerPackageParts: List[String], isGivenOrExtension: Boolean, symbols: Set[String]) extends Product with Serializable

    Top level declaration.

    Top level declaration.

    name

    short name of the declaration

    innerPackageParts

    inner packages as list of parts

    isGivenOrExtension

    if the declaration is an extension or given

    symbols

    all the symbols that are represented by basePackage.innerPackageParts.name E.g. file://root/a/b/c/File.scala package a.b package c { package d { case class O { } } } TopLevelDeclaration("O", List("d"), false, List("a.b.c.d.O#", "a.b.c.d.O."))

  147. case class UserConfiguration(javaHome: Option[String] = None, sbtScript: Option[String] = None, gradleScript: Option[String] = None, mavenScript: Option[String] = None, millScript: Option[String] = None, scalafmtConfigPath: Option[io.AbsolutePath] = None, scalafixConfigPath: Option[io.AbsolutePath] = None, symbolPrefixes: Map[String, String] = PresentationCompilerConfig.defaultSymbolPrefixes().asScala.toMap, worksheetScreenWidth: Int = 120, worksheetCancelTimeout: Int = 4, bloopSbtAlreadyInstalled: Boolean = false, bloopVersion: Option[String] = None, bloopJvmProperties: Option[List[String]] = None, ammoniteJvmProperties: Option[List[String]] = None, superMethodLensesEnabled: Boolean = false, inlayHintsOptions: InlayHintsOptions = InlayHintsOptions(Map.empty), enableStripMarginOnTypeFormatting: Boolean = true, enableIndentOnPaste: Boolean = false, enableSemanticHighlighting: Boolean = true, excludedPackages: Option[List[String]] = None, fallbackScalaVersion: Option[String] = None, testUserInterface: TestUserInterfaceKind = TestUserInterfaceKind.CodeLenses, javaFormatConfig: Option[JavaFormatConfig] = None, scalafixRulesDependencies: List[String] = Nil, customProjectRoot: Option[String] = None, verboseCompilation: Boolean = false, automaticImportBuild: AutoImportBuildKind = AutoImportBuildKind.Off, scalaCliLauncher: Option[String] = None, defaultBspToBuildTool: Boolean = false) extends Product with Serializable

    Configuration that the user can override via workspace/didChangeConfiguration.

  148. case class UserConfigurationOption(key: String, default: String, example: String, title: String, description: String) extends Product with Serializable

    A setting that users can configure via LSP workspace/didChangeConfiguration.

    A setting that users can configure via LSP workspace/didChangeConfiguration.

    See also

    UserConfiguration.options for available options.

  149. class UserConfigurationSync extends AnyRef
  150. final class Warnings extends AnyRef

    A helper to construct clear and actionable warning messages.

  151. case class WindowStateDidChangeParams(focused: java.lang.Boolean) extends Product with Serializable
  152. class WorkDoneProgress extends Cancelable
  153. final class WorksheetDependencySources extends AnyRef
  154. class WorkspaceChoicePopup extends AnyRef
  155. class WorkspaceFolders extends AnyRef
  156. case class WorkspaceFoldersServices(services: List[MetalsLspService], nonScalaFolders: List[Folder]) extends Product with Serializable
  157. class WorkspaceLspService extends ScalaLspService
  158. class WorkspaceSearchVisitor extends SymbolSearchVisitor

    A symbol search visitor for workspace/symbol.

    A symbol search visitor for workspace/symbol.

    - workspace symbols are converted directly to l.SymbolInformation - classpath symbols are converted into "goto definition" requests, which creates files on disk, and then into l.SymbolInformation.

  159. final class WorkspaceSymbolProvider extends AnyRef

    Implements workspace/symbol for both workspace sources and dependency classpath.

  160. case class WorkspaceSymbolsIndex(bloom: StringBloomFilter, symbols: Seq[WorkspaceSymbolInformation]) extends Product with Serializable

    An index of symbols defined in workspace sources.

    An index of symbols defined in workspace sources.

    The path is stored as keys in WorkspaceSymbolProvider.

    bloom

    the Fuzzy.bloomFilterSymbolStrings index of all symbols.

    symbols

    the symbols defined in this source file.

Value Members

  1. object AbsoluteDir extends java.io.Serializable
  2. object AbsoluteFile extends java.io.Serializable
  3. object AdjustedLspData extends java.io.Serializable
  4. object AutoImportBuildKind
  5. object BatchedFunction
  6. object BloopDir
  7. object BloopServers
  8. case object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  9. object BuildServerConnection
  10. object BuildTargets
  11. object CancelTokens

    Constructs an async CancelToken.

    Constructs an async CancelToken.

    The CancelChecker API in lsp4j is un-sufficient for our needs because we want to get a Future[Boolean] that completes to true when the user cancels a request, allowing us to abort expensive computation like typechecking as soon as possible. With CancelChecker, we need to explicitly call token.checkCancelled(), which is not possible inside the compiler.

  12. object Cancelable
  13. object CancelableFuture extends java.io.Serializable
  14. object ClientCommands

    Optional commands that metals expects the client to implement.

  15. object ClientConfiguration
  16. object ClientExperimentalCapabilities extends java.io.Serializable
  17. object CommandHTMLFormat
  18. object Compilers
  19. object ConcurrentHashSet

    Helper to construct a concurrent mutable set.

  20. object Configs
  21. object Confirmation
  22. object ContextSymbols extends java.io.Serializable
  23. object Debug

    Small utilities that are helpful for println debugging.

  24. object DecoderResponse extends java.io.Serializable
  25. object DefaultAdjustedData extends AdjustLspData
  26. object DefaultSymbolDefinitionOrdering extends Ordering[SymbolDefinition]
  27. object DefinitionResult extends java.io.Serializable
  28. object DelegateSetting
  29. object DidFocusResult extends Enumeration
  30. object Directories
  31. object DocumentSymbolConfig extends java.io.Serializable
  32. object Embedded
  33. object EmptyScalafmtReporter extends ScalafmtReporter

    A Scalafmt reporter that ignores all messages

  34. object EscapableString
  35. object ExecuteClientCommandConfig extends java.io.Serializable
  36. object FallbackMetalsLspService
  37. object FileDecoderProvider
  38. object FileOutOfScalaCliBspScope
  39. object Folder
  40. object FormattingProvider
  41. object FutureCancelToken extends java.io.Serializable
  42. object Icons
  43. object ImportEdits extends java.io.Serializable
  44. object ImportedBuild extends java.io.Serializable
  45. object Indexer extends java.io.Serializable
  46. object InitializationOptions extends java.io.Serializable
  47. object InlayHintsOption
  48. object InlayHintsOptions extends java.io.Serializable
  49. object JarSourcesProvider
  50. object JavaBinary
  51. object JavaInteractiveSemanticdb
  52. object JdbcEnrichments
  53. object JdkVersion extends java.io.Serializable
  54. object JsonParser
  55. object JvmOpts

    Support for the .jvmopts file loaded by the sbt launcher script as alternative to command line options.

  56. object JvmSignatures
  57. object LoggerReportContext extends ReportContext
  58. object LoggerReporter extends Reporter
  59. object Memory
  60. object Messages

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

  61. object MetalsEnrichments extends AsJavaExtensions with AsScalaExtensions with MtagsEnrichments

    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.meta.internal.jdk.CollectionConverters._

    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.

  62. object MetalsHttpServer
  63. object MetalsServerConfig extends java.io.Serializable
  64. object MetalsServerInputs extends java.io.Serializable
  65. object MtagsBinaries
  66. object MtagsResolver
  67. object ObjectSymbol
  68. object OpenBrowserCommand extends java.io.Serializable
  69. object PackageProvider
  70. object PathMatcher
  71. object Pauseable
  72. object PopupChoiceReset
  73. object ProgressTicks
  74. object ReferencesResult extends java.io.Serializable
  75. object SbtOpts

    Support for the .sbtopts file loaded by the sbt launcher script as alternative to command line options.

  76. object ScalaDocLink extends java.io.Serializable
  77. object ScalaVersions extends ScalaVersions
  78. object ScalacDiagnostic
  79. object ScalafixProvider extends java.io.Serializable
  80. object ScalafmtConfig extends java.io.Serializable
  81. object ScalafmtDialect
  82. object SemanticTokensProvider

    Provides semantic tokens of file according to the LSP specification.

  83. object ServerCommands

    LSP commands supported by the Metals language server.

  84. object ServerLivenessMonitor
  85. object StacktraceAnalyzer
  86. object StandaloneSymbolSearch
  87. object StandardConvention
  88. object StatisticsConfig extends java.io.Serializable
  89. object StatusBarConfig extends java.io.Serializable
  90. object StringCase
  91. object SyntheticPackageObject
  92. object Synthetics

    Utilities to work with SemanticDB synthetics.

  93. object Tables
  94. object TargetData
  95. object TaskProgress
  96. object TestUserInterfaceKind
  97. object ThreadPools
  98. object Time
  99. object Timer
  100. object Trace

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

  101. object Urls
  102. object UserConfiguration extends java.io.Serializable
  103. object WorkDoneProgress
  104. object WorkspaceChoicePopup
  105. object ZipReportsProvider

Ungrouped