aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assist_context.rs
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-07-15 14:45:30 +0100
committerJeremy Kolb <[email protected]>2020-07-15 14:45:30 +0100
commit21c1504ca972d59307a065f72154e50bd32aa763 (patch)
treee6c25847e4de5a87bf677ea2e23f2efa9343ba5f /crates/ra_assists/src/assist_context.rs
parent6a7d1d4412cd1047f309605156ea9f6cd8f3d997 (diff)
Move allow list into AssistConfig
Diffstat (limited to 'crates/ra_assists/src/assist_context.rs')
-rw-r--r--crates/ra_assists/src/assist_context.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs
index 9ca2cfe68..3407df856 100644
--- a/crates/ra_assists/src/assist_context.rs
+++ b/crates/ra_assists/src/assist_context.rs
@@ -57,7 +57,6 @@ pub(crate) struct AssistContext<'a> {
57 pub(crate) sema: Semantics<'a, RootDatabase>, 57 pub(crate) sema: Semantics<'a, RootDatabase>,
58 pub(crate) frange: FileRange, 58 pub(crate) frange: FileRange,
59 source_file: SourceFile, 59 source_file: SourceFile,
60 allowed: Option<Vec<AssistKind>>,
61} 60}
62 61
63impl<'a> AssistContext<'a> { 62impl<'a> AssistContext<'a> {
@@ -65,10 +64,9 @@ impl<'a> AssistContext<'a> {
65 sema: Semantics<'a, RootDatabase>, 64 sema: Semantics<'a, RootDatabase>,
66 config: &'a AssistConfig, 65 config: &'a AssistConfig,
67 frange: FileRange, 66 frange: FileRange,
68 allowed: Option<Vec<AssistKind>>,
69 ) -> AssistContext<'a> { 67 ) -> AssistContext<'a> {
70 let source_file = sema.parse(frange.file_id); 68 let source_file = sema.parse(frange.file_id);
71 AssistContext { config, sema, frange, source_file, allowed } 69 AssistContext { config, sema, frange, source_file }
72 } 70 }
73 71
74 pub(crate) fn db(&self) -> &RootDatabase { 72 pub(crate) fn db(&self) -> &RootDatabase {
@@ -114,7 +112,7 @@ impl Assists {
114 resolve: true, 112 resolve: true,
115 file: ctx.frange.file_id, 113 file: ctx.frange.file_id,
116 buf: Vec::new(), 114 buf: Vec::new(),
117 allowed: ctx.allowed.clone(), 115 allowed: ctx.config.allowed.clone(),
118 } 116 }
119 } 117 }
120 118
@@ -123,7 +121,7 @@ impl Assists {
123 resolve: false, 121 resolve: false,
124 file: ctx.frange.file_id, 122 file: ctx.frange.file_id,
125 buf: Vec::new(), 123 buf: Vec::new(),
126 allowed: ctx.allowed.clone(), 124 allowed: ctx.config.allowed.clone(),
127 } 125 }
128 } 126 }
129 127