xsbti
package xsbti
Type Members
-
trait
Action extends AnyRef
An Action is very miminal representation of a
CodeActionin the LSP protocol.An Action is very miminal representation of a
CodeActionin the LSP protocol.However it only focuses on the actual title, description, and edit, leaving it up to the language server to communicate with the client and put together a proper codeAction in accordance to client capabilities.
- See also
- trait AnalysisCallback extends AnyRef
-
trait
AnalysisCallback2 extends AnalysisCallback
Extension to AnalsysisCallback.
Extension to AnalsysisCallback. This is a compatibility layer created for Scala 3.x compilers. Even though compiler-interface is NOT intended to be a public API, Scala 3 compiler publishes their own compiler bridge against Zinc de jour. By having this interface, they can test if
callbacksupports AnalysisCallback2. -
trait
AnalysisCallback3 extends AnalysisCallback2
Extension to
AnalysisCallback2.Extension to
AnalysisCallback2. Similar toAnalysisCallback2, it serves as compatibility layer for Scala compilers. -
final
class
ArtifactInfo extends AnyRef
Define constants of Scala compiler useful for artifact resolution.
- class BasicVirtualFileRef extends VirtualFileRef
-
abstract
class
CompileCancelled extends RuntimeException
Represent the cancellation of a compilation run.
Represent the cancellation of a compilation run. This failure extends
RuntimeExceptionthat you can catch at the use-site. -
abstract
class
CompileFailed extends RuntimeException
Represent a failure occurred during compilation of Java or Scala sources.
Represent a failure occurred during compilation of Java or Scala sources. This failure extends
RuntimeExceptionthat you can catch at the use-site. - abstract class CompileFailed2 extends CompileFailed
-
trait
DiagnosticCode extends AnyRef
A DiagnosticCode is a unique identifier that the compiler can associate with a diagnostic.
A DiagnosticCode is a unique identifier that the compiler can associate with a diagnostic. This is useful for tools to be able to quickly identify what diagnostic is being reported without having to rely on parsing the actual diagnostic message, which might not be stable.
-
trait
DiagnosticRelatedInformation extends AnyRef
Related information for a given diagnostic.
Related information for a given diagnostic. At times this can be another place in your code contributing to the diagnostic or just relevant code relating to the diagnostic.
- trait FileConverter extends AnyRef
-
trait
InteractiveConsoleFactory extends AnyRef
Interface for running console interactively.
Interface for running console interactively. An implementation is loaded using java.util.ServiceLoader.
- trait InteractiveConsoleInterface extends Closeable
-
trait
InteractiveConsoleResponse extends AnyRef
Public interface for repl responses.
- sealed abstract final class InteractiveConsoleResult extends Enum[InteractiveConsoleResult]
- trait Logger extends AnyRef
- trait PathBasedFile extends VirtualFile
- trait Position extends AnyRef
- trait Problem extends AnyRef
-
trait
Reporter extends AnyRef
Define an interface for a reporter of the compiler.
Define an interface for a reporter of the compiler.
The reporter exposes compilation errors coming from either Scala or Java compilers. This includes messages with any level of severity: from error, to warnings and infos.
- sealed abstract final class Severity extends Enum[Severity]
-
trait
T2[A1, A2] extends AnyRef
Used to pass a pair of values.
-
trait
TextEdit extends AnyRef
A representation of the
TextEditfound in the LSP protocol.A representation of the
TextEditfound in the LSP protocol.NOTE: That instead of a
Rangewe use the internal xsbti.Position.- See also
<a href="https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textEdit">
TextEdit
-
sealed abstract final
class
UseScope extends Enum[UseScope]
Defines the scope in which a name hash was captured.
Defines the scope in which a name hash was captured.
The incremental compiler uses UseScope to determine some Scala semantics assumed in the presence of a name in a concrete position. For instance, PatMatTarget is used for names that appear as the target types of a pattern match.
The order of declaration of these is crucial. Don't change it. Don't add more than 6 scopes. Otherwise, change
Mapperimplementation. - trait VirtualDirectory extends VirtualFileRef
-
trait
VirtualFile extends VirtualFileRef
VirtualFileis an abstraction for file-like objects.VirtualFileis an abstraction for file-like objects. Unlikejava.io.Fileorjava.nio.file.Paththat are tied to filesystem-related capabilities,VirtualFileis designed to be a less-capable object with identity, content reading, and content hashing. See alsoVirtualFileRefOne of the goals of this virtual file (as opposed to a concrete file) is to abstract from the machine and user specifics. Previous Zinc's
Analysismetadata files stored file paths usingjava.io.File. This impeded them from being shared across machines without pre- and post-processing them appropriately.To create a
VirtualFileyou may use aFileConverter, such asMappedFileConverter.MappedFileConverterinternally stores the root paths to the working directory, Coursier's cache, etc..., and it will create aVirtualFilewith anidthat looks like${BASE}/src/main/example/A.scala.A
VirtualFilecan also be created with plainStrings to represent the content, without any "real" files.OK, but how does the compiler compile these?
See
IncrementalCompiler.java. At the top layer of Zinc, we are passing in the source files as a sequence ofVirtualFiles. The files then gets wrapped by a datatype calledAbstractZincFile, which extendsscala.reflect.io.AbstractFile, which the compiler is able to compile. -
trait
VirtualFileRef extends AnyRef
VirtualFileRefrepresents a reference to a file-like object.VirtualFileRefrepresents a reference to a file-like object. Unlikejava.io.Fileorjava.nio.file.Paththat are tied to filesystem-related capabilities,VirtualFileRefis designed to be a less-capable pointer to an object whose main feature is having a path-like identity. The equality is expected to be implemented using the equality of theid()alone. SeeBasicVirtualFileRef.VirtualFile, a subtype ofVirtualFileRefsupports minimally viable file-like opration needed for compilation. To illustrate the difference between the two, consider the following flow of operation.Flow of operation
Suppose that there are two people Alice and Bob who are working on the same repo. On Alice's machine, the build tool would construct an instance of
FileConverterused for the entire build. The reference implementation issbt.internal.inc.MappedFileConverter. The build tool would pass the usual suspect of absolute paths to thisMappedFileConvertersuch as the base directory of the working directory, Coursier cache directory, etc. Given the sequence of Scala and Java source files,MappedFileConverterwill create a sequence ofMappedVirtualFilewhoseidwould look like${BASE}/src/main/example/A.scala.When Alice runs the compilation,
Analysisfile will store theVirtualFileRefrepresented by itsid. This extends not only to the source files, but also to*.classproducts and library JAR files. SeeMRelationsNameHashing.Suppose then we are able to package the
Analysistogether with the*.classfiles in a JAR file, Bob on a different machine can extract it, and have the sameAnalysisfile. The only difference would be that on his machine the build tool would have created a slightly differentFileConverterwith different base paths. Because${BASE}/src/main/example/A.scalawould still be called the same, hopefully he can resume incremental compilation.Difference between VirtualFileRef and VirtualFile
VirtualFileRefon its own can only have identity information to be compared against another. At the most basic level this could be implemented asBasicVirtualFileRefthat has no ability of reading the content. On the other hand,VirtualFileis internally able to thaw itself back to the "real" file with the help of theFileConverter, and thus it might even be aware of the absolute paths.So when we look at the two types
VirtualFileRefandVirtualFile,VirtualFileRefcould represent a "path" for either the local machine or someone else's machine; on the other hand,VirtualFilewould represent something more concrete, like a local file or an in-memory file.ok, so how would the compiler compile this?
See
IncrementalCompile.scala. At the top layer of Zinc, we are passing in the source files as a sequence ofVirtualFiles. The files then gets wrapped by a datatype calledAbstractZincFile, which extendsscala.reflect.io.AbstractFile, which the compiler is able to compile. - trait VirtualFileWrite extends VirtualFile
-
trait
WorkspaceEdit extends AnyRef
A minimal representatin of the
WorkspaceEditfound in the LSP protocol.A minimal representatin of the
WorkspaceEditfound in the LSP protocol.However it only supports the minimal
changesto ensure the fixes will work with all clients.NOTE: In the future this may be expanded to handle resource operations via
documentChanges.- See also