mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-25 05:22:52 +00:00
refactor: introduce uri_for_id and deref_syntax_at (#267)
* dev: add documentation * refactor: introduce uri_for_id and deref_syntax_at
This commit is contained in:
parent
6d669461f9
commit
e2b7bc4b56
13 changed files with 236 additions and 174 deletions
|
|
@ -28,7 +28,7 @@ fn convert_diagnostic(
|
|||
let uri;
|
||||
let lsp_range;
|
||||
if let Some((id, span)) = diagnostic_span_id(typst_diagnostic) {
|
||||
uri = path_to_url(&ctx.path_for_id(id)?)?;
|
||||
uri = ctx.uri_for_id(id)?;
|
||||
let source = ctx.world().source(id)?;
|
||||
lsp_range = diagnostic_range(&source, span, ctx.position_encoding());
|
||||
} else {
|
||||
|
|
@ -63,7 +63,7 @@ fn tracepoint_to_relatedinformation(
|
|||
position_encoding: PositionEncoding,
|
||||
) -> anyhow::Result<Option<DiagnosticRelatedInformation>> {
|
||||
if let Some(id) = tracepoint.span.id() {
|
||||
let uri = path_to_url(&project.path_for_id(id)?)?;
|
||||
let uri = project.uri_for_id(id)?;
|
||||
let source = project.world().source(id)?;
|
||||
|
||||
if let Some(typst_range) = source.range(tracepoint.span) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue