mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
allow rustfmt to reorder imports
This wasn't a right decision in the first place, the feature flag was broken in the last rustfmt release, and syntax highlighting of imports is more important anyway
This commit is contained in:
parent
2b2cd829b0
commit
1834bae5b8
166 changed files with 798 additions and 814 deletions
|
@ -1,8 +1,9 @@
|
|||
use lsp_types::{
|
||||
CodeActionProviderCapability, CodeLensOptions, CompletionOptions, DocumentOnTypeFormattingOptions,
|
||||
ExecuteCommandOptions, FoldingRangeProviderCapability, RenameOptions, RenameProviderCapability,
|
||||
CodeActionProviderCapability, CodeLensOptions, CompletionOptions,
|
||||
DocumentOnTypeFormattingOptions, ExecuteCommandOptions, FoldingRangeProviderCapability,
|
||||
GenericCapability, ImplementationProviderCapability, RenameOptions, RenameProviderCapability,
|
||||
ServerCapabilities, SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind,
|
||||
TextDocumentSyncOptions, ImplementationProviderCapability, GenericCapability, TypeDefinitionProviderCapability
|
||||
TextDocumentSyncOptions, TypeDefinitionProviderCapability,
|
||||
};
|
||||
|
||||
pub fn server_capabilities() -> ServerCapabilities {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{
|
||||
project_model::{self, TargetKind},
|
||||
world::WorldSnapshot,
|
||||
Result
|
||||
Result,
|
||||
};
|
||||
|
||||
use ra_ide_api::{FileId, RunnableKind};
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use lsp_types::{
|
||||
self, CreateFile, Documentation, DocumentChangeOperation, DocumentChanges, Location, LocationLink,
|
||||
MarkupContent, MarkupKind, Position, Range, RenameFile, ResourceOp, SymbolKind, TextDocumentEdit, TextDocumentIdentifier,
|
||||
TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier,
|
||||
WorkspaceEdit,
|
||||
self, CreateFile, DocumentChangeOperation, DocumentChanges, Documentation, Location,
|
||||
LocationLink, MarkupContent, MarkupKind, Position, Range, RenameFile, ResourceOp, SymbolKind,
|
||||
TextDocumentEdit, TextDocumentIdentifier, TextDocumentItem, TextDocumentPositionParams, Url,
|
||||
VersionedTextDocumentIdentifier, WorkspaceEdit,
|
||||
};
|
||||
use ra_ide_api::{
|
||||
CompletionItem, CompletionItemKind, FileId, FilePosition, FileRange, FileSystemEdit,
|
||||
NavigationTarget, SourceChange, SourceFileEdit, RangeInfo,
|
||||
LineCol, LineIndex, translate_offset_with_edit, InsertTextFormat
|
||||
translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition,
|
||||
FileRange, FileSystemEdit, InsertTextFormat, LineCol, LineIndex, NavigationTarget, RangeInfo,
|
||||
SourceChange, SourceFileEdit,
|
||||
};
|
||||
use ra_syntax::{SyntaxKind, TextRange, TextUnit};
|
||||
use ra_text_edit::{AtomTextEdit, TextEdit};
|
||||
|
|
|
@ -10,4 +10,7 @@ pub mod init;
|
|||
mod world;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
|
||||
pub use crate::{caps::server_capabilities, main_loop::main_loop, main_loop::LspError, init::InitializationOptions};
|
||||
pub use crate::{
|
||||
caps::server_capabilities, init::InitializationOptions, main_loop::main_loop,
|
||||
main_loop::LspError,
|
||||
};
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use serde::Deserialize;
|
||||
use flexi_logger::{Duplicate, Logger};
|
||||
use gen_lsp_server::{run_server, stdio_transport};
|
||||
use serde::Deserialize;
|
||||
|
||||
use ra_lsp_server::{Result, InitializationOptions};
|
||||
use ra_lsp_server::{InitializationOptions, Result};
|
||||
use ra_prof;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
|
|
|
@ -2,7 +2,7 @@ mod handlers;
|
|||
mod subscriptions;
|
||||
pub(crate) mod pending_requests;
|
||||
|
||||
use std::{fmt, path::PathBuf, sync::Arc, time::Instant, error::Error};
|
||||
use std::{error::Error, fmt, path::PathBuf, sync::Arc, time::Instant};
|
||||
|
||||
use crossbeam_channel::{select, unbounded, Receiver, RecvError, Sender};
|
||||
use gen_lsp_server::{
|
||||
|
@ -10,21 +10,20 @@ use gen_lsp_server::{
|
|||
};
|
||||
use lsp_types::NumberOrString;
|
||||
use ra_ide_api::{Canceled, FileId, LibraryData};
|
||||
use ra_prof::profile;
|
||||
use ra_vfs::VfsTask;
|
||||
use serde::{de::DeserializeOwned, Serialize};
|
||||
use threadpool::ThreadPool;
|
||||
use ra_prof::profile;
|
||||
|
||||
use crate::{
|
||||
main_loop::{
|
||||
pending_requests::{PendingRequest, PendingRequests},
|
||||
subscriptions::Subscriptions,
|
||||
pending_requests::{PendingRequests, PendingRequest},
|
||||
},
|
||||
project_model::workspace_loader,
|
||||
req,
|
||||
world::{WorldSnapshot, WorldState},
|
||||
Result,
|
||||
InitializationOptions,
|
||||
InitializationOptions, Result,
|
||||
};
|
||||
|
||||
const THREADPOOL_SIZE: usize = 8;
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
use std::{io::Write as _, fmt::Write as _};
|
||||
use std::{fmt::Write as _, io::Write as _};
|
||||
|
||||
use gen_lsp_server::ErrorCode;
|
||||
use lsp_types::{
|
||||
CodeActionResponse, CodeLens, Command, Diagnostic, DiagnosticSeverity, CodeAction,
|
||||
DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange,
|
||||
FoldingRangeKind, FoldingRangeParams, Hover, HoverContents, Location, MarkupContent,
|
||||
MarkupKind, Position, PrepareRenameResponse, Range,
|
||||
RenameParams,SymbolInformation, TextDocumentIdentifier, TextEdit,
|
||||
WorkspaceEdit,
|
||||
CodeAction, CodeActionResponse, CodeLens, Command, Diagnostic, DiagnosticSeverity,
|
||||
DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeKind,
|
||||
FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, MarkupKind, Position,
|
||||
PrepareRenameResponse, Range, RenameParams, SymbolInformation, TextDocumentIdentifier,
|
||||
TextEdit, WorkspaceEdit,
|
||||
};
|
||||
use ra_ide_api::{
|
||||
FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, RunnableKind, Severity, Cancelable,
|
||||
AssistId,
|
||||
AssistId, Cancelable, FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo,
|
||||
RunnableKind, Severity,
|
||||
};
|
||||
use ra_syntax::{AstNode, SyntaxKind, TextUnit, TextRange};
|
||||
use ra_prof::profile;
|
||||
use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit};
|
||||
use rustc_hash::FxHashMap;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::to_value;
|
||||
use url_serde::Ser;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use thread_worker::Worker;
|
|||
use crate::Result;
|
||||
|
||||
pub use ra_project_model::{
|
||||
ProjectWorkspace, CargoWorkspace, Package, Target, TargetKind, Sysroot,
|
||||
CargoWorkspace, Package, ProjectWorkspace, Sysroot, Target, TargetKind,
|
||||
};
|
||||
|
||||
pub fn workspace_loader() -> Worker<PathBuf, Result<ProjectWorkspace>> {
|
||||
|
|
|
@ -4,12 +4,11 @@ use serde::{Deserialize, Serialize};
|
|||
use url_serde;
|
||||
|
||||
pub use lsp_types::{
|
||||
notification::*, request::*, ApplyWorkspaceEditParams, CodeActionParams, CodeLens, CodeLensParams,
|
||||
CompletionParams, CompletionResponse, DocumentOnTypeFormattingParams, DocumentSymbolParams,
|
||||
DocumentSymbolResponse, ExecuteCommandParams, Hover, InitializeResult,
|
||||
PublishDiagnosticsParams, ReferenceParams, SignatureHelp, TextDocumentEdit,
|
||||
TextDocumentPositionParams, TextEdit, WorkspaceEdit, WorkspaceSymbolParams,
|
||||
MessageType, ShowMessageParams,
|
||||
notification::*, request::*, ApplyWorkspaceEditParams, CodeActionParams, CodeLens,
|
||||
CodeLensParams, CompletionParams, CompletionResponse, DocumentOnTypeFormattingParams,
|
||||
DocumentSymbolParams, DocumentSymbolResponse, ExecuteCommandParams, Hover, InitializeResult,
|
||||
MessageType, PublishDiagnosticsParams, ReferenceParams, ShowMessageParams, SignatureHelp,
|
||||
TextDocumentEdit, TextDocumentPositionParams, TextEdit, WorkspaceEdit, WorkspaceSymbolParams,
|
||||
};
|
||||
|
||||
pub enum AnalyzerStatus {}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::PathBuf;
|
||||
use ra_project_model::ProjectRoot;
|
||||
use ra_vfs::{RootEntry, Filter, RelativePath};
|
||||
use ra_vfs::{Filter, RelativePath, RootEntry};
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// `IncludeRustFiles` is used to convert
|
||||
/// from `ProjectRoot` to `RootEntry` for VFS
|
||||
|
|
|
@ -3,22 +3,20 @@ use std::{
|
|||
sync::Arc,
|
||||
};
|
||||
|
||||
use gen_lsp_server::ErrorCode;
|
||||
use lsp_types::Url;
|
||||
use parking_lot::RwLock;
|
||||
use ra_ide_api::{
|
||||
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData,
|
||||
SourceRootId
|
||||
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData, SourceRootId,
|
||||
};
|
||||
use ra_vfs::{Vfs, VfsChange, VfsFile, VfsRoot};
|
||||
use relative_path::RelativePathBuf;
|
||||
use parking_lot::RwLock;
|
||||
use gen_lsp_server::ErrorCode;
|
||||
|
||||
use crate::{
|
||||
main_loop::pending_requests::{CompletedRequest, LatestRequests},
|
||||
project_model::ProjectWorkspace,
|
||||
vfs_filter::IncludeRustFiles,
|
||||
Result,
|
||||
LspError,
|
||||
LspError, Result,
|
||||
};
|
||||
|
||||
/// `WorldState` is the primary mutable state of the language server
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue