rename all things

This commit is contained in:
Aleksey Kladov 2018-09-16 12:54:24 +03:00
parent ba0bfeee12
commit b5021411a8
478 changed files with 219 additions and 204 deletions

View file

@ -1,7 +1,7 @@
[alias]
gen-kinds = "run --package tools -- gen-kinds"
gen-tests = "run --package tools -- gen-tests"
gen-kinds = "run --package tools -- gen-kinds"
gen-tests = "run --package tools -- gen-tests"
install-code = "run --package tools -- install-code"
render-test = "run --package cli -- render-test"
parse = "run --package cli -- parse"
render-test = "run --package ra_cli -- render-test"
parse = "run --package ra_cli -- parse"

View file

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
[dependencies]
languageserver-types = "0.49.0"
languageserver-types = "0.50.0"
log = "0.4.3"
failure = "0.1.2"

View file

@ -1,5 +1,5 @@
[package]
name = "libanalysis"
name = "ra_analysis"
version = "0.1.0"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
@ -12,8 +12,8 @@ once_cell = "0.1.5"
rayon = "1.0.2"
fst = "0.3.1"
im = "12.0.0"
libsyntax2 = { path = "../libsyntax2" }
libeditor = { path = "../libeditor" }
ra_syntax = { path = "../ra_syntax" }
ra_editor = { path = "../ra_editor" }
salsa = { path = "../salsa" }
[dev-dependencies]

View file

@ -2,7 +2,7 @@ use std::{
collections::BTreeMap,
};
use relative_path::RelativePathBuf;
use libsyntax2::{
use ra_syntax::{
SmolStr,
ast::{self, NameOwner},
};

View file

@ -9,8 +9,8 @@ use std::{
};
use relative_path::RelativePath;
use libeditor::{self, FileSymbol, LineIndex, find_node_at_offset, LocalEdit};
use libsyntax2::{
use ra_editor::{self, FileSymbol, LineIndex, find_node_at_offset, LocalEdit};
use ra_syntax::{
TextUnit, TextRange, SmolStr, File, AstNode,
SyntaxKind::*,
ast::{self, NameOwner},
@ -228,7 +228,7 @@ impl AnalysisImpl {
let module_tree = root.module_tree();
let syntax = root.syntax(file_id);
let mut res = libeditor::diagnostics(&syntax)
let mut res = ra_editor::diagnostics(&syntax)
.into_iter()
.map(|d| Diagnostic { range: d.range, message: d.msg, fix: None })
.collect::<Vec<_>>();
@ -277,10 +277,10 @@ impl AnalysisImpl {
let file = self.file_syntax(file_id);
let offset = range.start();
let actions = vec![
("flip comma", libeditor::flip_comma(&file, offset).map(|f| f())),
("add `#[derive]`", libeditor::add_derive(&file, offset).map(|f| f())),
("add impl", libeditor::add_impl(&file, offset).map(|f| f())),
("introduce variable", libeditor::introduce_variable(&file, range).map(|f| f())),
("flip comma", ra_editor::flip_comma(&file, offset).map(|f| f())),
("add `#[derive]`", ra_editor::add_derive(&file, offset).map(|f| f())),
("add impl", ra_editor::add_impl(&file, offset).map(|f| f())),
("introduce variable", ra_editor::introduce_variable(&file, range).map(|f| f())),
];
actions.into_iter()
.filter_map(|(name, local_edit)| {

View file

@ -2,8 +2,8 @@ extern crate parking_lot;
#[macro_use]
extern crate log;
extern crate once_cell;
extern crate libsyntax2;
extern crate libeditor;
extern crate ra_syntax;
extern crate ra_editor;
extern crate fst;
extern crate rayon;
extern crate relative_path;
@ -28,10 +28,10 @@ use std::{
};
use relative_path::{RelativePath, RelativePathBuf};
use libsyntax2::{File, TextRange, TextUnit, AtomEdit};
use ra_syntax::{File, TextRange, TextUnit, AtomEdit};
use imp::{AnalysisImpl, AnalysisHostImpl, FileResolverImp};
pub use libeditor::{
pub use ra_editor::{
StructureNode, LineIndex, FileSymbol,
Runnable, RunnableKind, HighlightedRange, CompletionItem,
};
@ -170,26 +170,26 @@ impl Analysis {
self.imp.file_line_index(file_id)
}
pub fn extend_selection(&self, file: &File, range: TextRange) -> TextRange {
libeditor::extend_selection(file, range).unwrap_or(range)
ra_editor::extend_selection(file, range).unwrap_or(range)
}
pub fn matching_brace(&self, file: &File, offset: TextUnit) -> Option<TextUnit> {
libeditor::matching_brace(file, offset)
ra_editor::matching_brace(file, offset)
}
pub fn syntax_tree(&self, file_id: FileId) -> String {
let file = self.imp.file_syntax(file_id);
libeditor::syntax_tree(&file)
ra_editor::syntax_tree(&file)
}
pub fn join_lines(&self, file_id: FileId, range: TextRange) -> SourceChange {
let file = self.imp.file_syntax(file_id);
SourceChange::from_local_edit(file_id, "join lines", libeditor::join_lines(&file, range))
SourceChange::from_local_edit(file_id, "join lines", ra_editor::join_lines(&file, range))
}
pub fn on_eq_typed(&self, file_id: FileId, offset: TextUnit) -> Option<SourceChange> {
let file = self.imp.file_syntax(file_id);
Some(SourceChange::from_local_edit(file_id, "add semicolon", libeditor::on_eq_typed(&file, offset)?))
Some(SourceChange::from_local_edit(file_id, "add semicolon", ra_editor::on_eq_typed(&file, offset)?))
}
pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
let file = self.imp.file_syntax(file_id);
libeditor::file_structure(&file)
ra_editor::file_structure(&file)
}
pub fn symbol_search(&self, query: Query, token: &JobToken) -> Vec<(FileId, FileSymbol)> {
self.imp.world_symbols(query, token)
@ -208,15 +208,15 @@ impl Analysis {
}
pub fn runnables(&self, file_id: FileId) -> Vec<Runnable> {
let file = self.imp.file_syntax(file_id);
libeditor::runnables(&file)
ra_editor::runnables(&file)
}
pub fn highlight(&self, file_id: FileId) -> Vec<HighlightedRange> {
let file = self.imp.file_syntax(file_id);
libeditor::highlight(&file)
ra_editor::highlight(&file)
}
pub fn completions(&self, file_id: FileId, offset: TextUnit) -> Option<Vec<CompletionItem>> {
let file = self.imp.file_syntax(file_id);
libeditor::scope_completion(&file, offset)
ra_editor::scope_completion(&file, offset)
}
pub fn assists(&self, file_id: FileId, range: TextRange) -> Vec<SourceChange> {
self.imp.assists(file_id, range)

View file

@ -1,6 +1,6 @@
use std::sync::Arc;
use libsyntax2::File;
use libeditor::LineIndex;
use ra_syntax::File;
use ra_editor::LineIndex;
use {
FileId,
db::{Query, QueryCtx, QueryRegistry},

View file

@ -6,8 +6,8 @@ use std::{
use once_cell::sync::OnceCell;
use rayon::prelude::*;
use libeditor::LineIndex;
use libsyntax2::File;
use ra_editor::LineIndex;
use ra_syntax::File;
use {
FileId,

View file

@ -2,8 +2,8 @@ use std::{
sync::Arc,
hash::{Hash, Hasher},
};
use libeditor::{FileSymbol, file_symbols};
use libsyntax2::{
use ra_editor::{FileSymbol, file_symbols};
use ra_syntax::{
File,
SyntaxKind::{self, *},
};

View file

@ -1,5 +1,5 @@
extern crate libanalysis;
extern crate relative_path;
extern crate ra_analysis;
extern crate test_utils;
use std::{
@ -8,7 +8,7 @@ use std::{
};
use relative_path::{RelativePath, RelativePathBuf};
use libanalysis::{Analysis, AnalysisHost, FileId, FileResolver, JobHandle, CrateGraph, CrateId};
use ra_analysis::{Analysis, AnalysisHost, FileId, FileResolver, JobHandle, CrateGraph, CrateId};
use test_utils::assert_eq_dbg;
#[derive(Debug)]

View file

@ -1,5 +1,5 @@
[package]
name = "cli"
name = "ra_cli"
version = "0.1.0"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
publish = false
@ -7,6 +7,6 @@ publish = false
[dependencies]
clap = "2.32.0"
failure = "0.1.1"
libsyntax2 = { path = "../libsyntax2" }
libeditor = { path = "../libeditor" }
ra_syntax = { path = "../ra_syntax" }
ra_editor = { path = "../ra_editor" }
tools = { path = "../tools" }

View file

@ -1,8 +1,8 @@
extern crate clap;
#[macro_use]
extern crate failure;
extern crate libsyntax2;
extern crate libeditor;
extern crate ra_syntax;
extern crate ra_editor;
extern crate tools;
use std::{
@ -11,13 +11,13 @@ use std::{
};
use clap::{App, Arg, SubCommand};
use tools::collect_tests;
use libsyntax2::File;
use libeditor::{syntax_tree, file_structure};
use ra_syntax::File;
use ra_editor::{syntax_tree, file_structure};
type Result<T> = ::std::result::Result<T, failure::Error>;
fn main() -> Result<()> {
let matches = App::new("libsyntax2-cli")
let matches = App::new("ra-cli")
.setting(clap::AppSettings::SubcommandRequiredElseHelp)
.subcommand(
SubCommand::with_name("render-test")

View file

@ -1,5 +1,5 @@
[package]
name = "libeditor"
name = "ra_editor"
version = "0.1.0"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
publish = false
@ -9,7 +9,7 @@ itertools = "0.7.8"
superslice = "0.1.0"
join_to_string = "0.1.1"
libsyntax2 = { path = "../libsyntax2" }
ra_syntax = { path = "../ra_syntax" }
[dev-dependencies]
test_utils = { path = "../test_utils" }

View file

@ -1,6 +1,6 @@
use join_to_string::join;
use libsyntax2::{
use ra_syntax::{
File, TextUnit, TextRange,
ast::{self, AstNode, AttrsOwner, TypeParamsOwner, NameOwner},
SyntaxKind::{COMMA, WHITESPACE},

View file

@ -1,6 +1,6 @@
use std::collections::{HashSet, HashMap};
use libsyntax2::{
use ra_syntax::{
File, TextUnit, AstNode, SyntaxNodeRef, SyntaxKind::*,
ast::{self, LoopBodyOwner, ModuleItemOwner},
algo::{

View file

@ -1,5 +1,5 @@
use {TextRange, TextUnit};
use libsyntax2::{
use ra_syntax::{
AtomEdit,
text_utils::contains_offset_nonstrict,
};

View file

@ -1,4 +1,4 @@
use libsyntax2::{
use ra_syntax::{
File, TextRange, SyntaxNodeRef, TextUnit,
SyntaxKind::*,
algo::{find_leaf_at_offset, LeafAtOffset, find_covering_node, ancestors, Direction, siblings},

View file

@ -1,4 +1,4 @@
extern crate libsyntax2;
extern crate ra_syntax;
extern crate superslice;
extern crate itertools;
extern crate join_to_string;
@ -17,13 +17,13 @@ mod scope;
#[cfg(test)]
mod test_utils;
use libsyntax2::{
use ra_syntax::{
File, TextUnit, TextRange, SyntaxNodeRef,
ast::{self, AstNode, NameOwner},
algo::{walk, find_leaf_at_offset, ancestors},
SyntaxKind::{self, *},
};
pub use libsyntax2::AtomEdit;
pub use ra_syntax::AtomEdit;
pub use self::{
line_index::{LineIndex, LineCol},
extend_selection::extend_selection,
@ -124,7 +124,7 @@ pub fn diagnostics(file: &File) -> Vec<Diagnostic> {
}
pub fn syntax_tree(file: &File) -> String {
::libsyntax2::utils::dump_tree(file.syntax())
::ra_syntax::utils::dump_tree(file.syntax())
}
pub fn runnables(file: &File) -> Vec<Runnable> {

View file

@ -3,7 +3,7 @@ use std::{
collections::HashMap,
};
use libsyntax2::{
use ra_syntax::{
SyntaxNodeRef, SyntaxNode, SmolStr, AstNode,
ast::{self, NameOwner, LoopBodyOwner, ArgListOwner},
algo::{ancestors, generate, walk::preorder}
@ -244,7 +244,7 @@ struct ScopeData {
#[cfg(test)]
mod tests {
use super::*;
use libsyntax2::File;
use ra_syntax::File;
use {find_node_at_offset, test_utils::extract_offset};
fn do_check(code: &str, expected: &[&str]) {

View file

@ -1,4 +1,4 @@
use libsyntax2::{
use ra_syntax::{
AstNode, SyntaxNode, SyntaxNodeRef, SmolStr,
ast::{self, AstChildren},
};
@ -86,7 +86,7 @@ fn collect_imports(tree: ast::UseTree, acc: &mut Vec<Entry>) {
#[cfg(test)]
mod tests {
use super::*;
use libsyntax2::{File, ast::ModuleItemOwner};
use ra_syntax::{File, ast::ModuleItemOwner};
fn do_check(code: &str, expected: &[&str]) {
let file = File::parse(&code);

View file

@ -1,4 +1,4 @@
use libsyntax2::{
use ra_syntax::{
SyntaxKind, SyntaxNodeRef, AstNode, File, SmolStr,
ast::{self, NameOwner},
algo::{

View file

@ -1,4 +1,4 @@
use libsyntax2::{File, TextUnit, TextRange};
use ra_syntax::{File, TextUnit, TextRange};
pub use _test_utils::*;
use LocalEdit;

View file

@ -1,6 +1,6 @@
use std::mem;
use libsyntax2::{
use ra_syntax::{
TextUnit, TextRange, SyntaxNodeRef, File, AstNode, SyntaxKind,
ast,
algo::{

View file

@ -1,5 +1,5 @@
[package]
name = "m"
name = "ra_lsp_server"
version = "0.1.0"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
@ -15,16 +15,16 @@ crossbeam-channel = "0.2.4"
flexi_logger = "0.9.1"
log = "0.4.3"
url_serde = "0.2.0"
languageserver-types = "0.49.0"
languageserver-types = "0.50.0"
walkdir = "2.2.0"
im = "12.0.0"
cargo_metadata = "0.6.0"
text_unit = { version = "0.1.2", features = ["serde"] }
smol_str = { version = "0.1.5", features = ["serde"] }
libsyntax2 = { path = "../libsyntax2" }
libeditor = { path = "../libeditor" }
libanalysis = { path = "../libanalysis" }
ra_syntax = { path = "../ra_syntax" }
ra_editor = { path = "../ra_editor" }
ra_analysis = { path = "../ra_analysis" }
gen_lsp_server = { path = "../gen_lsp_server" }
[dev-dependencies]

View file

@ -3,9 +3,9 @@ use languageserver_types::{
TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem,
TextDocumentPositionParams, TextDocumentEdit,
};
use libeditor::{LineIndex, LineCol, Edit, AtomEdit};
use libsyntax2::{SyntaxKind, TextUnit, TextRange};
use libanalysis::{FileId, SourceChange, SourceFileEdit, FileSystemEdit};
use ra_editor::{LineIndex, LineCol, Edit, AtomEdit};
use ra_syntax::{SyntaxKind, TextUnit, TextRange};
use ra_analysis::{FileId, SourceChange, SourceFileEdit, FileSystemEdit};
use {
Result,

View file

@ -18,9 +18,9 @@ extern crate relative_path;
extern crate cargo_metadata;
extern crate gen_lsp_server;
extern crate libeditor;
extern crate libanalysis;
extern crate libsyntax2;
extern crate ra_editor;
extern crate ra_analysis;
extern crate ra_syntax;
mod caps;
pub mod req;

View file

@ -4,11 +4,11 @@ extern crate log;
extern crate failure;
extern crate flexi_logger;
extern crate gen_lsp_server;
extern crate m;
extern crate ra_lsp_server;
use flexi_logger::{Logger, Duplicate};
use gen_lsp_server::{run_server, stdio_transport};
use m::Result;
use ra_lsp_server::Result;
fn main() -> Result<()> {
::std::env::set_var("RUST_BACKTRACE", "short");
@ -34,12 +34,12 @@ fn main_inner() -> Result<()> {
let (receiver, sender, threads) = stdio_transport();
let cwd = ::std::env::current_dir()?;
run_server(
m::server_capabilities(),
ra_lsp_server::server_capabilities(),
|params, r, s| {
let root = params.root_uri
.and_then(|it| it.to_file_path().ok())
.unwrap_or(cwd);
m::main_loop(false, root, r, s)
ra_lsp_server::main_loop(false, root, r, s)
},
receiver,
sender,

View file

@ -7,8 +7,8 @@ use languageserver_types::{
CompletionItem, InsertTextFormat, CompletionItemKind,
};
use serde_json::to_value;
use libanalysis::{Query, FileId, RunnableKind, JobToken};
use libsyntax2::{
use ra_analysis::{Query, FileId, RunnableKind, JobToken};
use ra_syntax::{
text_utils::contains_offset_nonstrict,
};

View file

@ -10,7 +10,7 @@ use serde::{Serialize, de::DeserializeOwned};
use crossbeam_channel::{unbounded, Sender, Receiver};
use rayon::{self, ThreadPool};
use languageserver_types::{NumberOrString};
use libanalysis::{FileId, JobHandle, JobToken, LibraryData};
use ra_analysis::{FileId, JobHandle, JobToken, LibraryData};
use gen_lsp_server::{
RawRequest, RawNotification, RawMessage, RawResponse, ErrorCode,
handle_shutdown,

View file

@ -1,5 +1,5 @@
use std::collections::HashSet;
use libanalysis::FileId;
use ra_analysis::FileId;
pub struct Subscriptions {
subs: HashSet<FileId>,

View file

@ -1,7 +1,7 @@
use std::path::{PathBuf, Path, Component};
use im;
use relative_path::RelativePath;
use libanalysis::{FileId, FileResolver};
use ra_analysis::{FileId, FileResolver};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Root {

View file

@ -3,7 +3,7 @@ use std::{
path::{Path, PathBuf},
};
use cargo_metadata::{metadata_run, CargoOpt};
use libsyntax2::SmolStr;
use ra_syntax::SmolStr;
use {
Result,

View file

@ -6,7 +6,7 @@ use std::{
};
use languageserver_types::Url;
use libanalysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver};
use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver};
use {
Result,

View file

@ -6,11 +6,11 @@ extern crate serde;
extern crate serde_json;
extern crate gen_lsp_server;
extern crate flexi_logger;
extern crate m;
extern crate ra_lsp_server;
mod support;
use m::req::{Runnables, RunnablesParams};
use ra_lsp_server::req::{Runnables, RunnablesParams};
use support::project;

View file

@ -21,7 +21,7 @@ use serde::Serialize;
use serde_json::{Value, from_str, to_string_pretty};
use gen_lsp_server::{RawMessage, RawRequest, RawNotification};
use m::{main_loop, req, thread_watcher::{ThreadWatcher, Worker}};
use ra_lsp_server::{main_loop, req, thread_watcher::{ThreadWatcher, Worker}};
pub fn project(fixture: &str) -> Server {
static INIT: Once = Once::new();

View file

@ -1,5 +1,5 @@
[package]
name = "libsyntax2"
name = "ra_syntax"
version = "0.1.0"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
license = "MIT OR Apache-2.0"

View file

@ -1,6 +1,6 @@
[package]
name = "libsyntax2-fuzz"
name = "ra_syntax-fuzz"
version = "0.0.1"
authors = ["Automatically generated"]
publish = false
@ -8,7 +8,7 @@ publish = false
[package.metadata]
cargo-fuzz = true
[dependencies.libsyntax2]
[dependencies.ra_syntax]
path = ".."
[dependencies.libfuzzer-sys]
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"

View file

@ -1,9 +1,9 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate libsyntax2;
extern crate ra_syntax;
fuzz_target!(|data: &[u8]| {
if let Ok(text) = std::str::from_utf8(data) {
libsyntax2::utils::check_fuzz_invariants(text)
ra_syntax::utils::check_fuzz_invariants(text)
}
});

Some files were not shown because too many files have changed in this diff Show more