Skip to content

Commit

Permalink
clean up offsets import
Browse files Browse the repository at this point in the history
  • Loading branch information
Druue committed Jun 27, 2024
1 parent a85e605 commit 3171b65
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions prisma-fmt/src/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use psl::{
Diagnostics, SourceFile,
};

use crate::LSPContext;
use crate::{offsets::position_to_offset, LSPContext};

pub(super) type HoverContext<'a> = LSPContext<'a, HoverParams>;

Expand All @@ -16,7 +16,7 @@ impl<'a> HoverContext<'a> {
let pos = self.params.text_document_position_params.position;
let initiating_doc = self.initiating_file_source();

super::position_to_offset(&pos, initiating_doc)
position_to_offset(&pos, initiating_doc)
}
}

Expand Down
3 changes: 2 additions & 1 deletion prisma-fmt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ mod hover;
mod lint;
mod merge_schemas;
mod native;
mod offsets;
mod preview;
mod schema_file_input;
mod text_document_completion;
mod validate;

pub mod offsets;

use log::*;
use psl::{
datamodel_connector::Connector, diagnostics::FileId, parser_database::ParserDatabase, Configuration, Datasource,
Expand Down
3 changes: 2 additions & 1 deletion prisma-fmt/tests/code_actions/test_api.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use lsp_types::{Diagnostic, DiagnosticSeverity};
use once_cell::sync::Lazy;
use prisma_fmt::span_to_range;

use prisma_fmt::offsets::span_to_range;
use psl::{diagnostics::Span, SourceFile};
use std::{fmt::Write as _, io::Write as _, path::PathBuf};

Expand Down

0 comments on commit 3171b65

Please sign in to comment.