Types

Core types

JuliaWorkspaces.JuliaWorkspaceType
struct JuliaWorkspace

The central handle representing a Julia workspace. It wraps a Salsa runtime that holds all mutable inputs (the set of files, the active project, and dynamic-feature results) and memoizes every derived query computed from them. A workspace is manipulated through the mutation functions (add_file!, update_file!, remove_file!, …) and inspected through the query functions (get_diagnostics, get_julia_syntax_tree, …).

Constructor

JuliaWorkspace(; dynamic=DynamicOff, store_path=nothing,
                 symbolcache_download=false,
                 symbolcache_upstream=DEFAULT_SYMBOLCACHE_UPSTREAM,
                 indirect_file_watch_callback=nothing,
                 progress_callback=nothing)

Create an empty workspace. To build one directly from folders on disc, use workspace_from_folders instead.

Keyword arguments

  • dynamic::DynamicMode: Whether and how to run the out-of-process dynamic feature that indexes environments. See DynamicMode.
  • store_path::Union{Nothing,String}: Directory used to cache package symbol data (.jstore files). Defaults to a managed scratch space.
  • symbolcache_download::Bool: If true, allow downloading precomputed symbol caches from symbolcache_upstream rather than indexing locally.
  • symbolcache_upstream::String: Upstream URL for symbol-cache downloads. Defaults to DEFAULT_SYMBOLCACHE_UPSTREAM.
  • indirect_file_watch_callback::Union{Nothing,Function}: Invoked once with a URI the first time an indirect file (a file pulled in via include but not explicitly added) is requested. Intended for a host to register a file watcher.
  • progress_callback::Union{Nothing,Function}: Invoked with progress updates while the dynamic feature indexes environments.
source
JuliaWorkspaces.SourceTextType
struct SourceText

A source text, consisting of its content, line indices, and language ID.

  • content::String
  • line_indices::Vector{Int}
  • language_id::String
source
JuliaWorkspaces.DiagnosticType
struct Diagnostic

A diagnostic struct, consisting of range, severity, message, and source.

  • range::UnitRange{Int64}
  • severity::Symbol
  • message::String
  • uri::Union{Nothing,URI}
  • tags::Vector{Symbol}
  • source::String
source

Dynamic feature

JuliaWorkspaces.DynamicModeType
@enum DynamicMode DynamicOff DynamicIndexingOnly DynamicPersistent

Controls how a JuliaWorkspace uses the out-of-process dynamic feature that indexes package environments and resolves symbol information.

  • DynamicOff: No dynamic feature is started. The workspace only relies on statically available information (parsed sources, Project.toml/Manifest.toml contents, and any locally cached symbol data). Environment-dependent diagnostics are suppressed because no environment can be resolved.
  • DynamicIndexingOnly: Child Julia processes are spawned to index project and test environments (populating the on-disc symbol cache), but they are torn down once indexing completes. Use this for one-shot tools such as CI runs.
  • DynamicPersistent: Like DynamicIndexingOnly, but the child processes are kept alive so the workspace can react to ongoing changes. Use this for long-running hosts such as a language server.

See also is_ready, wait_until_ready.

source

Completion result types

JuliaWorkspaces.CompletionResultType
struct CompletionResult

The full result of a completion request.

  • is_incomplete::Bool: true if the list is truncated and should be recomputed as the user keeps typing.
  • items::Vector{CompletionResultItem}: The completion candidates.
source
JuliaWorkspaces.CompletionResultItemType
struct CompletionResultItem

A single completion candidate, expressed without any LSP types.

  • label::String: Text shown in the completion list.
  • kind::Int: A CompletionKinds value.
  • detail, detail_label, detail_description: Optional detail strings.
  • documentation::Union{Nothing,String}: Optional markdown documentation.
  • sort_text, filter_text: Optional overrides for sorting/filtering.
  • insert_text_format::Int: An InsertFormats value.
  • text_edit::CompletionEdit: The primary edit applied on acceptance.
  • additional_edits::Vector{CompletionEdit}: Extra edits (for example new imports).
  • data::Union{Nothing,String}: Opaque payload carried through to resolution.
source
JuliaWorkspaces.CompletionEditType
struct CompletionEdit

A text edit attached to a completion item, expressed with Position values rather than LSP types.

  • start::Position: Start of the range to replace.
  • stop::Position: End of the range to replace.
  • new_text::String: Replacement text.
  • uri::Union{Nothing,URI}: Target file, or nothing for the current file.
source

Reference, definition and rename result types

JuliaWorkspaces.DefinitionResultType
struct DefinitionResult

The location a go-to-definition request resolves to.

  • uri::URI: File containing the definition.
  • start::Position: Start of the definition's name range.
  • stop::Position: End of the definition's name range.
source
JuliaWorkspaces.ReferenceResultType
struct ReferenceResult

A single location where a symbol is referenced (used by find-references).

  • uri::URI: File containing the reference.
  • start::Position: Start of the reference range.
  • stop::Position: End of the reference range.
source
JuliaWorkspaces.RenameEditType
struct RenameEdit

A single text edit that renames an occurrence of a symbol.

  • uri::URI: File the edit applies to.
  • start::Position: Start of the range to replace.
  • stop::Position: End of the range to replace.
  • new_text::String: Replacement text.
source
JuliaWorkspaces.HighlightResultType
struct HighlightResult

A document-highlight range for an occurrence of a symbol.

  • start::Position: Start of the occurrence.
  • stop::Position: End of the occurrence.
  • kind::Symbol: :read or :write, indicating whether the occurrence reads or writes the symbol.
source

Signature help result types

JuliaWorkspaces.SignatureResultType
struct SignatureResult

The result of a signature-help request at a call site.

  • signatures::Vector{SignatureInfo}: Candidate signatures for the call.
  • active_signature::Int: Index of the signature to highlight.
  • active_parameter::Int: Index of the parameter to highlight.
source
JuliaWorkspaces.SignatureInfoType
struct SignatureInfo

Describes a single callable signature in a signature-help result.

  • label::String: The full signature rendered as text.
  • documentation::String: Documentation for the signature.
  • parameters::Vector{ParameterInfo}: The signature's parameters in order.
source
JuliaWorkspaces.ParameterInfoType
struct ParameterInfo

Describes a single parameter of a function signature in signature help.

  • label::String: The parameter's textual label as it appears in the signature.
  • documentation::Union{String,Nothing}: Optional documentation for the parameter.
source

Symbol result types

JuliaWorkspaces.DocumentSymbolResultType
struct DocumentSymbolResult

A node in the document-outline tree (document symbols).

  • name::String: Display name of the symbol.
  • kind::Int: LSP SymbolKind integer.
  • start::Position: Start of the symbol's range.
  • stop::Position: End of the symbol's range.
  • children::Vector{DocumentSymbolResult}: Nested symbols.
source
JuliaWorkspaces.WorkspaceSymbolResultType
struct WorkspaceSymbolResult

A single match returned by a workspace-wide symbol search.

  • name::String: Display name of the symbol.
  • kind::Int: LSP SymbolKind integer.
  • uri::URI: File containing the symbol.
  • start::Position: Start of the symbol's range.
  • stop::Position: End of the symbol's range.
source
JuliaWorkspaces.SelectionRangeResultType
struct SelectionRangeResult

A nested selection range used to grow/shrink an editor selection. Each result points to its enclosing range via parent, forming a chain from the innermost to the outermost syntactic construct.

  • start::Position: Start of this selection range.
  • stop::Position: End of this selection range.
  • parent::Union{Nothing,SelectionRangeResult}: The enclosing range, or nothing for the outermost range.
source
JuliaWorkspaces.BlockRangeResultType
struct BlockRangeResult

Describes the syntactic block surrounding a position, distinguishing the full block extent from the sub-range to highlight.

  • block_start::Position: Start of the enclosing block.
  • highlight_start::Position: Start of the range to highlight.
  • highlight_stop::Position: End of the range to highlight.
  • block_stop::Position: End of the enclosing block.
source
JuliaWorkspaces.DocumentLinkResultType
struct DocumentLinkResult

A clickable link discovered in a source file (for example a path in a string literal passed to include).

  • start::Position: Start of the link's text range.
  • stop::Position: End of the link's text range.
  • target_uri::URI: The link target.
source
JuliaWorkspaces.InlayHintResultType
struct InlayHintResult

A single inlay hint rendered inline in the editor.

  • position::Position: Where the hint is anchored.
  • label::String: Hint text.
  • kind::Symbol: :parameter (a parameter name) or :type (an inferred type).
  • padding_left::Bool: Whether to render padding before the hint.
  • padding_right::Bool: Whether to render padding after the hint.
source
JuliaWorkspaces.InlayHintConfigType
struct InlayHintConfig

Configuration controlling which inlay hints are produced.

  • enabled::Bool: Master switch for inlay hints.
  • variable_types::Bool: Whether to show inferred variable type hints.
  • parameter_names::Symbol: Which parameter-name hints to show: :all, :literals, or :nothing.
source

Code action result types

JuliaWorkspaces.CodeActionInfoType
struct CodeActionInfo

Describes a code action that is available at a given location, without yet computing its edits. Pass its id to execute_code_action to obtain the concrete edits.

  • id::String: Stable identifier of the action.
  • title::String: Human-readable title shown to the user.
  • kind::Symbol: One of :quickfix, :refactor, :refactor_rewrite, :source_organize_imports, or :empty.
  • is_preferred::Bool: Whether this action should be offered as the preferred fix.
source
JuliaWorkspaces.TextEditResultType
struct TextEditResult

A single text replacement produced by a code action.

  • start::Position: Start of the range to replace.
  • stop::Position: End of the range to replace.
  • new_text::String: Replacement text.
source
JuliaWorkspaces.WorkspaceFileEditType
struct WorkspaceFileEdit

A group of TextEditResult edits that apply to a single file, as part of a workspace-wide edit produced by a code action.

  • uri::URI: File the edits apply to.
  • edits::Vector{TextEditResult}: Edits for that file.
source

Internal types

JuliaWorkspaces.PositionType
struct Position

A position in a source file expressed as a 1-based line number and a 1-based UTF-8 byte column within that line.

  • line::Int: 1-based line number.
  • column::Int: 1-based UTF-8 byte offset from the start of the line.
source
JuliaWorkspaces.JuliaTestEnvType
struct JuliaTestEnv

Details of a Julia test environment.

  • package_name::String
  • package_uri::Union{URI,Nothing}
  • project_uri::Union{URI,Nothing}
  • env_content_hash::Union{UInt,Nothing}
source
JuliaWorkspaces.JuliaProjectType
struct JuliaProject

Details of a Julia project.

  • project_file_uri::URI
  • manifest_file_uri::URI
  • julia_version::Union{Nothing,VersionNumber}
  • content_hash::UInt64
  • deved_packages::Dict{String,JuliaProjectEntryDevedPackage}
  • regular_packages::Dict{String,JuliaProjectEntryRegularPackage}
  • stdlib_packages::Dict{String,JuliaProjectEntryStdlibPackage}
source
JuliaWorkspaces.TestDetailsType
struct TestDetails

Details of a test.

  • testitems::Vector{TestItemDetail}
  • testsetups::Vector{TestSetupDetail}
  • testerrors::Vector{TestErrorDetail}
source
JuliaWorkspaces.TestItemDetailType
struct TestItemDetail

Details of a test item.

  • uri::URI
  • id::String
  • name::String
  • code::String
  • range::UnitRange{Int}
  • code_range::UnitRange{Int}
  • option_default_imports::Bool
  • option_tags::Vector{Symbol}
  • option_setup::Vector{Symbol}
source
JuliaWorkspaces.URIs2.URIType
struct URI

Details of a Unified Resource Identifier.

  • scheme::Union{Nothing, String}
  • authority::Union{Nothing, String}
  • path::String
  • query::Union{Nothing, String}
  • fragment::Union{Nothing, String}
source