Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
psteinroe committed Dec 11, 2024
1 parent 14209ef commit 06da729
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/pg_syntax/src/statement_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl<'p> StatementParser<'p> {

if !self.node_is_open(&node_idx) {
// open all nodes from `self.current_node` to the target node `node_idx`
let mut ancestors = self.ancestors(Some(node_idx));
let ancestors = self.ancestors(Some(node_idx));
let mut nodes_to_open = Vec::<NodeIndex<DefaultIx>>::new();
// including the target node itself
nodes_to_open.push(node_idx);
Expand Down
1 change: 1 addition & 0 deletions crates/pg_workspace_new/src/workspace/server/change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ impl ChangedStatement {
}

impl StatementChange {
#[allow(dead_code)]
pub fn statement_ref(&self) -> &StatementRef {
match self {
StatementChange::Added(stmt) => &stmt.ref_,
Expand Down
5 changes: 5 additions & 0 deletions crates/pg_workspace_new/src/workspace/server/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ impl Document {
}
}

#[allow(dead_code)]
pub fn get_statements(&self) -> &[StatementPosition] {
&self.statements
}
Expand All @@ -73,6 +74,7 @@ impl Document {
.collect()
}

#[allow(dead_code)]
/// Returns the statement ref at the given offset
pub fn statement_ref_at_offset(&self, offset: &TextSize) -> Option<StatementRef> {
self.statements.iter().find_map(|r| {
Expand All @@ -84,6 +86,7 @@ impl Document {
})
}

#[allow(dead_code)]
/// Returns the statement refs at the given range
pub fn statement_refs_at_range(&self, range: &TextRange) -> Vec<StatementRef> {
self.statements
Expand All @@ -95,6 +98,7 @@ impl Document {
.collect()
}

#[allow(dead_code)]
/// Returns the statement at the given offset
pub fn statement_at_offset(&self, offset: &TextSize) -> Option<Statement> {
self.statements.iter().find_map(|r| {
Expand All @@ -106,6 +110,7 @@ impl Document {
})
}

#[allow(dead_code)]
/// Returns the statements at the given range
pub fn statements_at_range(&self, range: &TextRange) -> Vec<Statement> {
self.statements
Expand Down

0 comments on commit 06da729

Please sign in to comment.