Skip to content

Commit fa3c9ce

Browse files
committed
fix usages after rename
1 parent 1967884 commit fa3c9ce

File tree

10 files changed

+62
-45
lines changed

10 files changed

+62
-45
lines changed

Cargo.lock

Lines changed: 34 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ra_analysis/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ parking_lot = "0.7.0"
1616
unicase = "2.2.0"
1717

1818
ra_syntax = { path = "../ra_syntax" }
19-
ra_editor = { path = "../ra_editor" }
19+
ra_ide_api_light = { path = "../ra_ide_api_light" }
2020
ra_text_edit = { path = "../ra_text_edit" }
2121
ra_db = { path = "../ra_db" }
2222
hir = { path = "../ra_hir", package = "ra_hir" }

crates/ra_analysis/src/extend_selection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) fn extend_selection(db: &RootDatabase, frange: FileRange) -> TextRang
1414
if let Some(range) = extend_selection_in_macro(db, &source_file, frange) {
1515
return range;
1616
}
17-
ra_editor::extend_selection(source_file.syntax(), frange.range).unwrap_or(frange.range)
17+
ra_ide_api_light::extend_selection(source_file.syntax(), frange.range).unwrap_or(frange.range)
1818
}
1919

2020
fn extend_selection_in_macro(
@@ -25,7 +25,7 @@ fn extend_selection_in_macro(
2525
let macro_call = find_macro_call(source_file.syntax(), frange.range)?;
2626
let (off, exp) = hir::MacroDef::ast_expand(macro_call)?;
2727
let dst_range = exp.map_range_forward(frange.range - off)?;
28-
let dst_range = ra_editor::extend_selection(&exp.syntax(), dst_range)?;
28+
let dst_range = ra_ide_api_light::extend_selection(&exp.syntax(), dst_range)?;
2929
let src_range = exp.map_range_back(dst_range)? + off;
3030
Some(src_range)
3131
}

crates/ra_analysis/src/imp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use hir::{
66
self, Problem, source_binder,
77
};
88
use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase};
9-
use ra_editor::{self, assists, LocalEdit, Severity};
9+
use ra_ide_api_light::{self, assists, LocalEdit, Severity};
1010
use ra_syntax::{
1111
TextRange, AstNode, SourceFile,
1212
ast::{self, NameOwner},
@@ -194,7 +194,7 @@ impl db::RootDatabase {
194194
pub(crate) fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> {
195195
let syntax = self.source_file(file_id);
196196

197-
let mut res = ra_editor::diagnostics(&syntax)
197+
let mut res = ra_ide_api_light::diagnostics(&syntax)
198198
.into_iter()
199199
.map(|d| Diagnostic {
200200
range: d.range,

crates/ra_analysis/src/lib.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub use crate::{
4444
completion::{CompletionItem, CompletionItemKind, InsertText},
4545
runnables::{Runnable, RunnableKind},
4646
};
47-
pub use ra_editor::{
47+
pub use ra_ide_api_light::{
4848
Fold, FoldKind, HighlightedRange, Severity, StructureNode,
4949
LineIndex, LineCol, translate_offset_with_edit,
5050
};
@@ -336,51 +336,54 @@ impl Analysis {
336336
/// Returns position of the mathcing brace (all types of braces are
337337
/// supported).
338338
pub fn matching_brace(&self, file: &SourceFile, offset: TextUnit) -> Option<TextUnit> {
339-
ra_editor::matching_brace(file, offset)
339+
ra_ide_api_light::matching_brace(file, offset)
340340
}
341341
/// Returns a syntax tree represented as `String`, for debug purposes.
342342
// FIXME: use a better name here.
343343
pub fn syntax_tree(&self, file_id: FileId) -> String {
344344
let file = self.db.source_file(file_id);
345-
ra_editor::syntax_tree(&file)
345+
ra_ide_api_light::syntax_tree(&file)
346346
}
347347
/// Returns an edit to remove all newlines in the range, cleaning up minor
348348
/// stuff like trailing commas.
349349
pub fn join_lines(&self, frange: FileRange) -> SourceChange {
350350
let file = self.db.source_file(frange.file_id);
351-
SourceChange::from_local_edit(frange.file_id, ra_editor::join_lines(&file, frange.range))
351+
SourceChange::from_local_edit(
352+
frange.file_id,
353+
ra_ide_api_light::join_lines(&file, frange.range),
354+
)
352355
}
353356
/// Returns an edit which should be applied when opening a new line, fixing
354357
/// up minor stuff like continuing the comment.
355358
pub fn on_enter(&self, position: FilePosition) -> Option<SourceChange> {
356359
let file = self.db.source_file(position.file_id);
357-
let edit = ra_editor::on_enter(&file, position.offset)?;
360+
let edit = ra_ide_api_light::on_enter(&file, position.offset)?;
358361
Some(SourceChange::from_local_edit(position.file_id, edit))
359362
}
360363
/// Returns an edit which should be applied after `=` was typed. Primarily,
361364
/// this works when adding `let =`.
362365
// FIXME: use a snippet completion instead of this hack here.
363366
pub fn on_eq_typed(&self, position: FilePosition) -> Option<SourceChange> {
364367
let file = self.db.source_file(position.file_id);
365-
let edit = ra_editor::on_eq_typed(&file, position.offset)?;
368+
let edit = ra_ide_api_light::on_eq_typed(&file, position.offset)?;
366369
Some(SourceChange::from_local_edit(position.file_id, edit))
367370
}
368371
/// Returns an edit which should be applied when a dot ('.') is typed on a blank line, indenting the line appropriately.
369372
pub fn on_dot_typed(&self, position: FilePosition) -> Option<SourceChange> {
370373
let file = self.db.source_file(position.file_id);
371-
let edit = ra_editor::on_dot_typed(&file, position.offset)?;
374+
let edit = ra_ide_api_light::on_dot_typed(&file, position.offset)?;
372375
Some(SourceChange::from_local_edit(position.file_id, edit))
373376
}
374377
/// Returns a tree representation of symbols in the file. Useful to draw a
375378
/// file outline.
376379
pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
377380
let file = self.db.source_file(file_id);
378-
ra_editor::file_structure(&file)
381+
ra_ide_api_light::file_structure(&file)
379382
}
380383
/// Returns the set of folding ranges.
381384
pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> {
382385
let file = self.db.source_file(file_id);
383-
ra_editor::folding_ranges(&file)
386+
ra_ide_api_light::folding_ranges(&file)
384387
}
385388
/// Fuzzy searches for a symbol.
386389
pub fn symbol_search(&self, query: Query) -> Cancelable<Vec<NavigationTarget>> {

crates/ra_analysis/src/syntax_highlighting.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
use ra_syntax::{ast, AstNode,};
2-
use ra_editor::HighlightedRange;
32
use ra_db::SyntaxDatabase;
43

54
use crate::{
5+
FileId, Cancelable, HighlightedRange,
66
db::RootDatabase,
7-
FileId, Cancelable,
87
};
98

109
pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> {
1110
let source_file = db.source_file(file_id);
12-
let mut res = ra_editor::highlight(source_file.syntax());
11+
let mut res = ra_ide_api_light::highlight(source_file.syntax());
1312
for macro_call in source_file
1413
.syntax()
1514
.descendants()
1615
.filter_map(ast::MacroCall::cast)
1716
{
1817
if let Some((off, exp)) = hir::MacroDef::ast_expand(macro_call) {
19-
let mapped_ranges = ra_editor::highlight(&exp.syntax())
18+
let mapped_ranges = ra_ide_api_light::highlight(&exp.syntax())
2019
.into_iter()
2120
.filter_map(|r| {
2221
let mapped_range = exp.map_range_back(r.range)?;

crates/ra_cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ clap = "2.32.0"
1010
failure = "0.1.4"
1111
join_to_string = "0.1.1"
1212
ra_syntax = { path = "../ra_syntax" }
13-
ra_editor = { path = "../ra_editor" }
13+
ra_ide_api_light = { path = "../ra_ide_api_light" }
1414
tools = { path = "../tools" }

crates/ra_cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{fs, io::Read, path::Path, time::Instant};
22

33
use clap::{App, Arg, SubCommand};
44
use join_to_string::join;
5-
use ra_editor::{extend_selection, file_structure, syntax_tree};
5+
use ra_ide_api_light::{extend_selection, file_structure, syntax_tree};
66
use ra_syntax::{SourceFile, TextRange, TreePtr, AstNode};
77
use tools::collect_tests;
88

crates/ra_ide_api_light/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
edition = "2018"
3-
name = "ra_editor"
3+
name = "ra_ide_api_light"
44
version = "0.1.0"
55
authors = ["Aleksey Kladov <[email protected]>"]
66
publish = false

crates/ra_ide_api_light/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
//! This crate provides thouse IDE features which use only a single file.
2+
//!
3+
//! This usually means functions which take sytnax tree as an input and produce
4+
//! an edit or some auxilarly info.
5+
16
pub mod assists;
27
mod extend_selection;
38
mod folding_ranges;

0 commit comments

Comments
 (0)