aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-28 16:17:19 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-28 16:17:19 +0000
commit7a268b9b9635425176f93d3c893fb5345e84e9ce (patch)
tree6ea69024cb22d3fc48a3b392a0185163fa452014 /crates/ra_db
parent9d6740a9c9ad2ca47c4885bd994f849e90bbef86 (diff)
parentb911ee542b2f4d1cd62a655f24197856cd9b9097 (diff)
Merge #350
350: Super simple macro support r=matklad a=matklad Super simple support for macros, mostly for figuring out how to fit them into the current architecture. Expansion is hard-coded and string based (mid-term, we should try to copy-paste macro-by-example expander from rustc). Ideally, we should handle * highlighting inside the macro (done) * extend selection inside the macro * completion inside the macro * indexing structs, produced by the macro Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_db')
-rw-r--r--crates/ra_db/src/lib.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs
index 3028db17c..7181f2950 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/ra_db/src/lib.rs
@@ -8,7 +8,7 @@ pub mod mock;
8use std::sync::Arc; 8use std::sync::Arc;
9 9
10use ra_editor::LineIndex; 10use ra_editor::LineIndex;
11use ra_syntax::{TextUnit, SourceFileNode}; 11use ra_syntax::{TextUnit, TextRange, SourceFileNode};
12 12
13pub use crate::{ 13pub use crate::{
14 cancelation::{Canceled, Cancelable}, 14 cancelation::{Canceled, Cancelable},
@@ -70,3 +70,9 @@ pub struct FilePosition {
70 pub file_id: FileId, 70 pub file_id: FileId,
71 pub offset: TextUnit, 71 pub offset: TextUnit,
72} 72}
73
74#[derive(Clone, Copy, Debug)]
75pub struct FileRange {
76 pub file_id: FileId,
77 pub range: TextRange,
78}