Skip to content

Commit 10c50b1

Browse files
committed
Format & replace todos with 'fixme'
1 parent f9893d3 commit 10c50b1

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

crates/ra_hir/src/code_model.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ impl ModuleDef {
192192
ModuleDef::Function(m) => Some(m.name(db)),
193193
ModuleDef::Adt(m) => Some(m.name(db)),
194194
ModuleDef::EnumVariant(m) => Some(m.name(db)),
195-
ModuleDef::Const(m) => {m.name(db)},
196-
ModuleDef::Static(m) => {m.name(db)},
197-
ModuleDef::Trait(m) => {Some(m.name(db))},
198-
ModuleDef::TypeAlias(m) => {Some(m.name(db))},
199-
ModuleDef::BuiltinType(m) => {Some(m.as_name())}
195+
ModuleDef::Const(m) => m.name(db),
196+
ModuleDef::Static(m) => m.name(db),
197+
ModuleDef::Trait(m) => Some(m.name(db)),
198+
ModuleDef::TypeAlias(m) => Some(m.name(db)),
199+
ModuleDef::BuiltinType(m) => Some(m.as_name()),
200200
}
201201
}
202202

@@ -205,13 +205,17 @@ impl ModuleDef {
205205
ModuleDef::Module(m) => Into::<ModuleId>::into(m.clone()).resolver(db),
206206
ModuleDef::Function(f) => Into::<FunctionId>::into(f.clone()).resolver(db),
207207
ModuleDef::Adt(adt) => Into::<AdtId>::into(adt.clone()).resolver(db),
208-
ModuleDef::EnumVariant(ev) => Into::<GenericDefId>::into(Into::<GenericDef>::into(ev.clone())).resolver(db),
209-
ModuleDef::Const(c) => Into::<GenericDefId>::into(Into::<GenericDef>::into(c.clone())).resolver(db),
208+
ModuleDef::EnumVariant(ev) => {
209+
Into::<GenericDefId>::into(Into::<GenericDef>::into(ev.clone())).resolver(db)
210+
}
211+
ModuleDef::Const(c) => {
212+
Into::<GenericDefId>::into(Into::<GenericDef>::into(c.clone())).resolver(db)
213+
}
210214
ModuleDef::Static(s) => Into::<StaticId>::into(s.clone()).resolver(db),
211215
ModuleDef::Trait(t) => Into::<TraitId>::into(t.clone()).resolver(db),
212216
ModuleDef::TypeAlias(t) => Into::<ModuleId>::into(t.module(db)).resolver(db),
213-
// TODO: This should be a resolver relative to `std`
214-
ModuleDef::BuiltinType(_t) => None?
217+
// FIXME: This should be a resolver relative to `std/core`
218+
ModuleDef::BuiltinType(_t) => None?,
215219
})
216220
}
217221
}

crates/ra_ide/src/hover.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,14 @@ fn try_resolve_intra(
540540

541541
let resolved = resolver.resolve_module_path_in_items(db, &modpath);
542542
let (defid, namespace) = match namespace {
543-
// TODO: .or(resolved.macros)
543+
// FIXME: .or(resolved.macros)
544544
None => resolved
545545
.types
546546
.map(|t| (t.0, Namespace::Types))
547547
.or(resolved.values.map(|t| (t.0, Namespace::Values)))?,
548548
Some(ns @ Namespace::Types) => (resolved.types?.0, ns),
549549
Some(ns @ Namespace::Values) => (resolved.values?.0, ns),
550-
// TODO:
550+
// FIXME:
551551
Some(Namespace::Macros) => None?,
552552
};
553553

@@ -558,7 +558,7 @@ fn try_resolve_intra(
558558
let ns = match namespace {
559559
Namespace::Types => ItemInNs::Types(defid),
560560
Namespace::Values => ItemInNs::Values(defid),
561-
// TODO:
561+
// FIXME:
562562
Namespace::Macros => None?,
563563
};
564564
let import_map = db.import_map(krate.into());
@@ -603,7 +603,7 @@ fn try_resolve_path(db: &RootDatabase, definition: &Definition, link: &str) -> O
603603
}
604604

605605
/// Try to get the root URL of the documentation of a crate.
606-
// TODO: Special case standard, core, alloc libraries
606+
// FIXME: Special case standard, core, alloc libraries
607607
fn get_doc_url(db: &RootDatabase, krate: &Crate) -> Option<Url> {
608608
// Look for #![doc(html_root_url = "...")]
609609
let attrs = db.attrs(AttrDef::from(krate.root_module(db)?).into());
@@ -621,7 +621,7 @@ fn get_doc_url(db: &RootDatabase, krate: &Crate) -> Option<Url> {
621621
}).next()
622622
} else {
623623
// Fallback to docs.rs
624-
// TODO: Specify an exact version here (from Cargo.lock)
624+
// FIXME: Specify an exact version here (from Cargo.lock)
625625
Some(format!("https://docs.rs/{}/*", krate.display_name(db)?))
626626
};
627627

@@ -648,7 +648,6 @@ fn get_symbol_filename(db: &RootDatabase, definition: &Definition) -> Option<Str
648648
format!("enum.{}.html#variant.{}", ev.parent_enum(db).name(db), ev.name(db))
649649
}
650650
ModuleDef::Const(c) => format!("const.{}.html", c.name(db)?),
651-
// TODO: Check this is the right prefix
652651
ModuleDef::Static(s) => format!("static.{}.html", s.name(db)?),
653652
},
654653
Definition::Macro(m) => format!("macro.{}.html", m.name(db)?),

crates/ra_ide_db/src/defs.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
// FIXME: this badly needs rename/rewrite (matklad, 2020-02-06).
77

88
use hir::{
9+
db::{DefDatabase, HirDatabase},
910
Field, HasVisibility, ImplDef, Local, MacroDef, Module, ModuleDef, Name, PathResolution,
10-
Semantics, TypeParam, Visibility, db::{DefDatabase, HirDatabase},
11+
Semantics, TypeParam, Visibility,
1112
};
1213
use ra_prof::profile;
1314
use ra_syntax::{
@@ -16,7 +17,7 @@ use ra_syntax::{
1617
};
1718

1819
use crate::RootDatabase;
19-
use ra_hir_def::resolver::{Resolver, HasResolver};
20+
use ra_hir_def::resolver::{HasResolver, Resolver};
2021

2122
// FIXME: a more precise name would probably be `Symbol`?
2223
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
@@ -83,12 +84,14 @@ impl Definition {
8384
use ra_hir_def::*;
8485
Some(match self {
8586
Definition::ModuleDef(def) => def.resolver(db)?,
86-
Definition::Field(field) => Into::<VariantId>::into(Into::<VariantDef>::into(field.parent_def(db))).resolver(db),
87+
Definition::Field(field) => {
88+
Into::<VariantId>::into(Into::<VariantDef>::into(field.parent_def(db))).resolver(db)
89+
}
8790
Definition::Macro(m) => Into::<ModuleId>::into(m.module(db)?).resolver(db),
8891
Definition::SelfType(imp) => Into::<ImplId>::into(imp.clone()).resolver(db),
8992
// it's possible, read probable, that other arms of this are also unreachable
9093
Definition::Local(_local) => unreachable!(),
91-
Definition::TypeParam(tp) => Into::<ModuleId>::into(tp.module(db)).resolver(db)
94+
Definition::TypeParam(tp) => Into::<ModuleId>::into(tp.module(db)).resolver(db),
9295
})
9396
}
9497
}

crates/ra_syntax/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use crate::syntax_node::GreenNode;
4747
pub use crate::{
4848
algo::InsertPosition,
4949
ast::{AstNode, AstToken},
50-
parsing::{lex_single_syntax_kind, lex_single_valid_syntax_kind, tokenize, Token, parse_text},
50+
parsing::{lex_single_syntax_kind, lex_single_valid_syntax_kind, parse_text, tokenize, Token},
5151
ptr::{AstPtr, SyntaxNodePtr},
5252
syntax_error::SyntaxError,
5353
syntax_node::{

crates/rust-analyzer/src/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use std::{
66
io::Write as _,
7-
process::{self, Stdio}
7+
process::{self, Stdio},
88
};
99

1010
use lsp_server::ErrorCode;

0 commit comments

Comments
 (0)