Expand description
Shared LSP response builders.
Structs§
- Char
Offsets - Maps a
yaml-rust2char index to a byte offset incontent, and a byte offset to the end of its containing line. - Dependency
Outcome - Everything the lifecycle fetch learned about one package, keyed by its normalized name.
- Dependency
Outcomes - Normalized-package-name ->
DependencyOutcomemap. - Diagnostic
Severities - Diagnostic severity levels for the four per-dependency issue categories.
- Line
Offset Table - Converts byte offsets in source text to LSP
Positionvalues. - Package
Versions - Registry version data for one package, fetched together in a single round trip.
- Version
Data - Bundles the two per-package version maps (
cached,resolved) that LSP handlers pass together everywhere.
Enums§
- Requirement
Status - Result of checking whether a dependency’s declared requirement is already satisfied by the latest known version.
Constants§
- CMD_
DOT_ FOOTER - The
Cmd+.update-footer markdown this function appends when a code action may exist for the hovered dependency. - DEPRECATED_
DIAGNOSTIC_ CODE - Stable [
Diagnostic::code] set on the package-level deprecation diagnostic (issue #205). - HOVER_
RECENT_ VERSIONS - Maximum number of recent versions hover’s “Recent versions” section renders.
- MAX_
FALLBACK_ SCAN_ BYTES - Upper bound, in bytes past
search_from, on how farlocate_value_span’s fallback scan will search. - UNSATISFIABLE_
DIAGNOSTIC_ CODE - Stable [
Diagnostic::code] set on the unsatisfiable-requirement diagnostic.
Traits§
- Diagnostic
Messages - Static wording for diagnostics and hover about yanked/deprecated package state.
- Diagnostic
Policy - Per-ecosystem opt-outs for which diagnostics apply to which dependency/requirement shapes.
- Ecosystem
Formatter - Umbrella marker for a complete ecosystem formatter.
- OsvNaming
- Native <-> OSV.dev namespace bridging for package names and version strings.
- Package
Naming - Ecosystem-specific package name normalization and validation.
- Package
Rendering - How a package/version renders into manifest text edits and hover content.
- Requirement
Matcher - A
requirementcompiled by one ecosystem, ready to test candidate versions against. - Requirement
Resolution - Requirement parsing, matching, and up-to-date status.
- Source
Policy - What a
DependencySourcemay be used for: resolution, vulnerability scanning, and cache-key/link trust.
Functions§
- collect_
update_ all_ edits - Manifest edits bringing every safely-editable outdated dependency to
latest. - compile_
requirement_ unless - Shared shape for a
crate::lsp_helpers::RequirementResolution::compile_requirementguarded by one predicate. - concrete_
pin_ version - Returns the concrete version text
requirementdenotes, orNoneifrequirementis not the shape of a single concrete version. - escape_
markdown - Escapes Markdown syntax characters so untrusted text cannot break out of the Markdown structure it is embedded in.
- generate_
code_ actions - Generates the code actions offered for the dependency at
position. - generate_
code_ lenses - Zero or one lens for the document, bound to
command_id. - generate_
diagnostics_ from_ cache - Generates diagnostics using cached versions (no network calls).
- generate_
hover - generate_
inlay_ hints - in_
use_ version - The version of
depthis project treats as actually in use. - is_
dot_ segment - Whether
segmentis exactly.or... - is_
full_ semver_ shape - Whether
shas the shape of a fullmajor.minor.patchversion. - is_
full_ sha - Whether
sis a 40-character hex string — a git commit SHA shape, shared by every ecosystem resolving refs against a git-tags-datasource API (GitHub, GitLab). - is_
safe_ maven_ coordinate_ segment - Whether
segmentis safe to embed as a MavengroupId/artifactIdvalue in a pom.xml [TextEdit] or completion item. - is_
safe_ package_ name - Whether
nameis safe to embed as a package name in a manifest [TextEdit] or completion item. - is_
safe_ registry_ url - Whether
urlis safe to embed as a Swift Package Manager repository URL in a Package.swift [TextEdit] or completion item. - is_
safe_ version_ string - Whether
versionis safe to embed in a manifest [TextEdit] or completion item. - is_
same_ major_ minor - Checks if two version strings have the same major and minor version.
- is_
tag_ shaped - Whether
shas the shape of a tag ref: an optional leadingv/Vfollowed by a digit. - locate_
value_ span - Finds the byte offset in
content(searching only within the line starting atsearch_from) where the literal bytes ofvalueoccur. - markdown_
code_ span - Wraps
contentin a Markdown inline code span (backticks included) that safely contains arbitrary untrusted text, regardless of embedded backticks. - match_
v_ prefix_ style - Rewrites
tagto matchcurrent’s leadingv/Vprefix style (or lack of one). - position_
in_ range - Checks whether a cursor position falls within an LSP range (inclusive on both ends).
- requirement_
is_ unsatisfiable - Returns
truewhen no published version satisfiesrequirement. - truncate_
for_ diagnostic - Truncates
valueto at mostmax_charscharacters, appending…when truncated. - warn_
rejected_ value - Logs a
tracing::warn!for a value rejected by anis_safe_*predicate (or an equivalent value-rejecting gate) before it reaches a manifest edit or registry URL.