Collapse proto Point into the one kind of use case, utf-16 coords
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
b58ae8bdd7
commit
a666ca3e40
2 changed files with 7 additions and 10 deletions
|
@ -6064,11 +6064,11 @@ fn serialize_symbol(symbol: &Symbol) -> proto::Symbol {
|
||||||
path: symbol.path.path.to_string_lossy().to_string(),
|
path: symbol.path.path.to_string_lossy().to_string(),
|
||||||
name: symbol.name.clone(),
|
name: symbol.name.clone(),
|
||||||
kind: unsafe { mem::transmute(symbol.kind) },
|
kind: unsafe { mem::transmute(symbol.kind) },
|
||||||
start: Some(proto::UnclippedPoint {
|
start: Some(proto::PointUtf16 {
|
||||||
row: symbol.range.start.0.row,
|
row: symbol.range.start.0.row,
|
||||||
column: symbol.range.start.0.column,
|
column: symbol.range.start.0.column,
|
||||||
}),
|
}),
|
||||||
end: Some(proto::UnclippedPoint {
|
end: Some(proto::PointUtf16 {
|
||||||
row: symbol.range.end.0.row,
|
row: symbol.range.end.0.row,
|
||||||
column: symbol.range.end.0.column,
|
column: symbol.range.end.0.column,
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -412,8 +412,10 @@ message Symbol {
|
||||||
string name = 4;
|
string name = 4;
|
||||||
int32 kind = 5;
|
int32 kind = 5;
|
||||||
string path = 6;
|
string path = 6;
|
||||||
UnclippedPoint start = 7;
|
// Cannot use generate anchors for unopend files,
|
||||||
UnclippedPoint end = 8;
|
// so we are forced to use point coords instead
|
||||||
|
PointUtf16 start = 7;
|
||||||
|
PointUtf16 end = 8;
|
||||||
bytes signature = 9;
|
bytes signature = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1042,12 +1044,7 @@ message Range {
|
||||||
uint64 end = 2;
|
uint64 end = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Point {
|
message PointUtf16 {
|
||||||
uint32 row = 1;
|
|
||||||
uint32 column = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message UnclippedPoint {
|
|
||||||
uint32 row = 1;
|
uint32 row = 1;
|
||||||
uint32 column = 2;
|
uint32 column = 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue