migrate analysis and server to 2018

This commit is contained in:
Aleksey Kladov 2018-10-15 20:15:53 +03:00
parent 2dd6858d03
commit bb298158eb
21 changed files with 42 additions and 36 deletions

View file

@ -7,7 +7,7 @@ use ra_editor::{LineIndex, LineCol, Edit, AtomEdit};
use ra_syntax::{SyntaxKind, TextUnit, TextRange};
use ra_analysis::{FileId, SourceChange, SourceFileEdit, FileSystemEdit};
use {
use crate::{
Result,
server_world::ServerWorld,
req,
@ -299,7 +299,7 @@ pub fn to_location(
Ok(loc)
}
pub trait MapConvWith<'a>: Sized {
pub trait MapConvWith<'a>: Sized + 'a {
type Ctx;
type Output;
@ -309,7 +309,7 @@ pub trait MapConvWith<'a>: Sized {
}
impl<'a, I> MapConvWith<'a> for I
where I: Iterator,
where I: Iterator + 'a,
I::Item: ConvWith
{
type Ctx = <I::Item as ConvWith>::Ctx;

View file

@ -34,5 +34,7 @@ mod project_model;
pub mod thread_watcher;
pub type Result<T> = ::std::result::Result<T, ::failure::Error>;
pub use caps::server_capabilities;
pub use main_loop::main_loop;
pub use crate::{
main_loop::main_loop,
caps::server_capabilities,
};

View file

@ -13,7 +13,7 @@ use ra_syntax::{
text_utils::contains_offset_nonstrict
};
use ::{
use crate::{
req::{self, Decoration}, Result,
conv::{Conv, ConvWith, TryConvWith, MapConvWith, to_location},
server_world::ServerWorld,

View file

@ -16,7 +16,7 @@ use gen_lsp_server::{
};
use rustc_hash::FxHashMap;
use {
use crate::{
req,
Result,
vfs::{self, FileEvent},

View file

@ -5,7 +5,7 @@ use rustc_hash::{FxHashMap, FxHashSet};
use cargo_metadata::{metadata_run, CargoOpt};
use ra_syntax::SmolStr;
use {
use crate::{
Result,
thread_watcher::{Worker, ThreadWatcher},
};

View file

@ -8,7 +8,7 @@ use rustc_hash::FxHashMap;
use languageserver_types::Url;
use ra_analysis::{FileId, AnalysisHost, Analysis, CrateGraph, CrateId, LibraryData, FileResolver};
use {
use crate::{
Result,
path_map::{PathMap, Root},
vfs::{FileEvent, FileEventKind},

View file

@ -1,7 +1,7 @@
use std::thread;
use crossbeam_channel::{bounded, unbounded, Sender, Receiver};
use drop_bomb::DropBomb;
use Result;
use crate::Result;
pub struct Worker<I, O> {
pub inp: Sender<I>,

View file

@ -5,7 +5,7 @@ use std::{
use walkdir::WalkDir;
use {
use crate::{
thread_watcher::{Worker, ThreadWatcher},
};