-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from yassinebridi/code-strucrutal-search
Code structural search
- Loading branch information
Showing
14 changed files
with
552 additions
and
200 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
use std::collections::HashMap; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone)] | ||
pub struct AstGrepOutput { | ||
pub text: String, | ||
pub range: Range, | ||
pub file: String, | ||
pub lines: String, | ||
pub replacement: Option<String>, | ||
#[serde(rename = "replacementOffsets")] | ||
pub replacement_offsets: Option<ReplacementOffsets>, | ||
pub language: String, | ||
#[serde(rename = "metaVariables")] | ||
pub meta_variables: Option<MetaVariables>, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone)] | ||
pub struct Range { | ||
#[serde(rename = "byteOffset")] | ||
pub byte_offset: ByteOffset, | ||
pub start: Position, | ||
pub end: Position, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone)] | ||
pub struct ByteOffset { | ||
pub start: usize, | ||
pub end: usize, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone)] | ||
pub struct Position { | ||
pub line: usize, | ||
pub column: usize, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone)] | ||
pub struct ReplacementOffsets { | ||
pub start: usize, | ||
pub end: usize, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone)] | ||
pub struct MetaVariables { | ||
pub single: HashMap<String, MetaVariable>, | ||
pub multi: HashMap<String, Vec<MetaVariable>>, | ||
pub transformed: HashMap<String, String>, | ||
} | ||
|
||
#[derive(Deserialize, Serialize, Debug, Clone)] | ||
pub struct MetaVariable { | ||
pub text: String, | ||
pub range: Range, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.