Skip to content

Commit 9fe33c3

Browse files
committed
progress
1 parent 94cad01 commit 9fe33c3

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

crates/pgt_lsp/tests/server.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,20 +1365,28 @@ async fn extends_config() -> Result<()> {
13651365
.await
13661366
.expect("Failed to setup test database");
13671367

1368+
tracing::info!(
1369+
"writing to {:?}",
1370+
url!("postgrestools.jsonc").to_file_path().unwrap(),
1371+
);
1372+
13681373
// shared config with default db connection
13691374
let conf_with_db = PartialConfiguration::init();
13701375
fs.insert(
13711376
url!("postgrestools.jsonc").to_file_path().unwrap(),
13721377
serde_json::to_string_pretty(&conf_with_db).unwrap(),
13731378
);
13741379

1380+
let relative_path = if cfg!(windows) {
1381+
"..\\postgrestools.jsonc"
1382+
} else {
1383+
"../postgrestools.jsonc"
1384+
};
1385+
13751386
// test_one extends the shared config but sets our test db
13761387
let mut conf_with_db = PartialConfiguration::init();
13771388
conf_with_db.merge_with(PartialConfiguration {
1378-
extends: Some(StringSet::from_iter([Path::new("..")
1379-
.join("postgrestools.jsonc")
1380-
.to_string_lossy()
1381-
.to_string()])),
1389+
extends: Some(StringSet::from_iter([relative_path.to_string()])),
13821390
db: Some(PartialDatabaseConfiguration {
13831391
database: Some(
13841392
test_db
@@ -1391,6 +1399,7 @@ async fn extends_config() -> Result<()> {
13911399
}),
13921400
..Default::default()
13931401
});
1402+
13941403
fs.insert(
13951404
url!("test_one/postgrestools.jsonc").to_file_path().unwrap(),
13961405
serde_json::to_string_pretty(&conf_with_db).unwrap(),
@@ -1399,10 +1408,7 @@ async fn extends_config() -> Result<()> {
13991408
// test_two extends it but keeps the default one
14001409
let mut conf_without_db = PartialConfiguration::init();
14011410
conf_without_db.merge_with(PartialConfiguration {
1402-
extends: Some(StringSet::from_iter([Path::new("..")
1403-
.join("postgrestools.jsonc")
1404-
.to_string_lossy()
1405-
.to_string()])),
1411+
extends: Some(StringSet::from_iter([relative_path.to_string()])),
14061412
..Default::default()
14071413
});
14081414
fs.insert(

crates/pgt_workspace/src/configuration.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ fn load_config(
130130
ConfigurationPathHint::None => file_system.working_directory().unwrap_or_default(),
131131
};
132132

133+
// REMOVE
134+
tracing::info!(
135+
"Searching for configuration files in {}",
136+
configuration_directory.display()
137+
);
138+
133139
// We first search for `postgrestools.jsonc` files
134140
if let Some(auto_search_result) = file_system.auto_search(
135141
&configuration_directory,

0 commit comments

Comments
 (0)