Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/bin/deltin-rs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ fn position_offset(
}

fn check_path_for_cli(path: &std::path::Path, json: bool) -> deltin_rs::api::CheckReport {
let run = || deltin_rs::api::check_path(path, &deltin_rs::semantic::provider::NoopProvider::new());
let run =
|| deltin_rs::api::check_path(path, &deltin_rs::semantic::provider::NoopProvider::new());
if json {
without_debug_output(run)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/hir/lower.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Lowering: SemanticProgram -> HirProgram (provenance-preserving).

use crate::hir::*;
use crate::semantic::SemanticProgram;
use crate::semantic::resolve::{BuiltinMember, Resolution};
use crate::semantic::symbols::{SymbolId, SymbolKind};
use crate::semantic::types::Type;
use crate::semantic::SemanticProgram;
use crate::syntax::ast::*;
use std::collections::HashMap;

Expand Down
2 changes: 1 addition & 1 deletion src/semantic/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! lives here alongside checking (documented simplification of the module
//! layout in docs/architecture.md §5).

use crate::diagnostics::{Phase, error};
use crate::diagnostics::{error, Phase};
use crate::semantic::provider::*;
use crate::semantic::resolve::{BuiltinMember, Resolution};
use crate::semantic::symbols::*;
Expand Down
2 changes: 1 addition & 1 deletion src/semantic/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//! adapter; canonical catalog data remains in `workshop-rs`.

use crate::span::{FileId, Span};
use workshop_rs::WorkshopError;
use workshop_rs::catalog::{Catalog, CatalogEntry, Kind, Locale};
use workshop_rs::WorkshopError;

/// Position a query name is used in.
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
Expand Down
274 changes: 201 additions & 73 deletions src/workshop.rs

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion tests/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,10 @@ fn compatibility_report_classifies_evidence_and_gaps() {
}));
for case in &report.cases {
if case.fixture.expect == deltin_rs::compatibility::ExpectedOutcome::Unknown {
assert_ne!(case.status, deltin_rs::compatibility::FixtureStatus::Matched);
assert_ne!(
case.status,
deltin_rs::compatibility::FixtureStatus::Matched
);
}
}
}
9 changes: 6 additions & 3 deletions tests/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ fn caller_config_takes_precedence_without_discovering_root_config() {
}),
});
assert!(project.diagnostics.is_empty(), "{:?}", project.diagnostics);
assert_eq!(project.sources.get(project.entry).name, PathBuf::from("src/lib.del"));
assert_eq!(
project.sources.get(project.entry).name,
PathBuf::from("src/lib.del")
);
assert!(project.sources.by_name(&PathBuf::from("ds.toml")).is_none());
}

Expand Down Expand Up @@ -116,8 +119,8 @@ fn invalid_ds_toml_is_a_project_diagnostic_with_config_provenance() {

#[test]
fn unreadable_ds_toml_uses_a_registered_config_source() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/project-fixtures/non-file-ds-toml");
let root =
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/project-fixtures/non-file-ds-toml");
let project = load_project(ProjectOptions {
root,
entry: None,
Expand Down
7 changes: 6 additions & 1 deletion tests/semantic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ use deltin_rs::semantic::check_project;
use deltin_rs::semantic::provider::NoopProvider;
use std::path::PathBuf;

fn check(text: &str) -> (Vec<deltin_rs::Diagnostic>, deltin_rs::semantic::SemanticProgram) {
fn check(
text: &str,
) -> (
Vec<deltin_rs::Diagnostic>,
deltin_rs::semantic::SemanticProgram,
) {
static COUNTER: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);
let n = COUNTER.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
let dir = std::env::temp_dir().join(format!("deltin-rs-semantic-{}-{n}", std::process::id()));
Expand Down
Loading