Have models indicate code locations in workflows using textual search, not symbol names (#17282)

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Max Brunsfeld
2024-09-02 18:20:05 -07:00
committed by GitHub
co-authored by Antonio Scandurra
parent c63c2015a6
commit b41ddbd018
4 changed files with 410 additions and 820 deletions
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -472,7 +472,7 @@ pub enum XmlTagKind {
Step,
Edit,
Path,
Symbol,
Search,
Within,
Operation,
Description,
@@ -1518,7 +1518,7 @@ impl Context {
if tag.kind == XmlTagKind::Edit && tag.is_open_tag {
let mut path = None;
let mut symbol = None;
let mut search = None;
let mut operation = None;
let mut description = None;
@@ -1527,7 +1527,7 @@ impl Context {
edits.push(WorkflowStepEdit::new(
path,
operation,
symbol,
search,
description,
));
break;
@@ -1536,7 +1536,7 @@ impl Context {
if tag.is_open_tag
&& [
XmlTagKind::Path,
XmlTagKind::Symbol,
XmlTagKind::Search,
XmlTagKind::Operation,
XmlTagKind::Description,
]
@@ -1555,8 +1555,8 @@ impl Context {
match kind {
XmlTagKind::Path => path = Some(content),
XmlTagKind::Operation => operation = Some(content),
XmlTagKind::Symbol => {
symbol = Some(content).filter(|s| !s.is_empty())
XmlTagKind::Search => {
search = Some(content).filter(|s| !s.is_empty())
}
XmlTagKind::Description => {
description =
+22 -22
View File
@@ -609,8 +609,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
<edit>«
<path>src/lib.rs</path>
<operation>insert_sibling_after</operation>
<symbol>fn one</symbol>
<operation>insert_after</operation>
<search>fn one</search>
<description>add a `two` function</description>
</edit>
</step>
@@ -634,8 +634,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
<edit>
<path>src/lib.rs</path>
<operation>insert_sibling_after</operation>
<symbol>fn one</symbol>
<operation>insert_after</operation>
<search>fn one</search>
<description>add a `two` function</description>
</edit>
</step>»
@@ -643,8 +643,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
also,",
&[&[WorkflowStepEdit {
path: "src/lib.rs".into(),
kind: WorkflowStepEditKind::InsertSiblingAfter {
symbol: "fn one".into(),
kind: WorkflowStepEditKind::InsertAfter {
search: "fn one".into(),
description: "add a `two` function".into(),
},
}]],
@@ -668,8 +668,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
<edit>
<path>src/lib.rs</path>
<operation>insert_sibling_after</operation>
<symbol>«fn zero»</symbol>
<operation>insert_after</operation>
<search>«fn zero»</search>
<description>add a `two` function</description>
</edit>
</step>
@@ -693,8 +693,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
<edit>
<path>src/lib.rs</path>
<operation>insert_sibling_after</operation>
<symbol>fn zero</symbol>
<operation>insert_after</operation>
<search>fn zero</search>
<description>add a `two` function</description>
</edit>
</step>»
@@ -702,8 +702,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
also,",
&[&[WorkflowStepEdit {
path: "src/lib.rs".into(),
kind: WorkflowStepEditKind::InsertSiblingAfter {
symbol: "fn zero".into(),
kind: WorkflowStepEditKind::InsertAfter {
search: "fn zero".into(),
description: "add a `two` function".into(),
},
}]],
@@ -731,8 +731,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
<edit>
<path>src/lib.rs</path>
<operation>insert_sibling_after</operation>
<symbol>fn zero</symbol>
<operation>insert_after</operation>
<search>fn zero</search>
<description>add a `two` function</description>
</edit>
</step>
@@ -762,8 +762,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
<edit>
<path>src/lib.rs</path>
<operation>insert_sibling_after</operation>
<symbol>fn zero</symbol>
<operation>insert_after</operation>
<search>fn zero</search>
<description>add a `two` function</description>
</edit>
</step>»
@@ -771,8 +771,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
also,",
&[&[WorkflowStepEdit {
path: "src/lib.rs".into(),
kind: WorkflowStepEditKind::InsertSiblingAfter {
symbol: "fn zero".into(),
kind: WorkflowStepEditKind::InsertAfter {
search: "fn zero".into(),
description: "add a `two` function".into(),
},
}]],
@@ -808,8 +808,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
<edit>
<path>src/lib.rs</path>
<operation>insert_sibling_after</operation>
<symbol>fn zero</symbol>
<operation>insert_after</operation>
<search>fn zero</search>
<description>add a `two` function</description>
</edit>
</step>»
@@ -817,8 +817,8 @@ async fn test_workflow_step_parsing(cx: &mut TestAppContext) {
also,",
&[&[WorkflowStepEdit {
path: "src/lib.rs".into(),
kind: WorkflowStepEditKind::InsertSiblingAfter {
symbol: "fn zero".into(),
kind: WorkflowStepEditKind::InsertAfter {
search: "fn zero".into(),
description: "add a `two` function".into(),
},
}]],
File diff suppressed because it is too large Load Diff