Skip to content

Commit a0fc649

Browse files
committed
fix unreachable pub
1 parent 44c3cc1 commit a0fc649

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

crates/ide-completion/src/completions/mod_.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
CompletionItem, Completions,
1515
};
1616

17-
/// Complete mod declaration, i.e. `mod ;`
17+
/// Complete mod declaration, i.e. `mod $0;`
1818
pub(crate) fn complete_mod(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> {
1919
let mod_under_caret = match ctx.name_ctx() {
2020
Some(NameContext { kind: NameKind::Module(mod_under_caret), .. })
@@ -28,7 +28,7 @@ pub(crate) fn complete_mod(acc: &mut Completions, ctx: &CompletionContext) -> Op
2828
let _p = profile::span("completion::complete_mod");
2929

3030
let mut current_module = ctx.module;
31-
// For `mod `, `ctx.module` is its parent, but for `mod f`, it's `mod f` itself, but we're
31+
// For `mod $0`, `ctx.module` is its parent, but for `mod f$0`, it's `mod f` itself, but we're
3232
// interested in its parent.
3333
if ctx.original_token.kind() == SyntaxKind::IDENT {
3434
if let Some(module) = ctx.original_token.ancestors().nth(1).and_then(ast::Module::cast) {

crates/ide-completion/src/context.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ pub(super) struct LifetimeContext {
123123
}
124124

125125
#[derive(Debug)]
126-
pub enum LifetimeKind {
126+
pub(super) enum LifetimeKind {
127127
LifetimeParam { is_decl: bool, param: ast::LifetimeParam },
128128
Lifetime,
129129
LabelRef,
130130
LabelDef,
131131
}
132132

133133
#[derive(Debug)]
134-
pub struct NameContext {
134+
pub(super) struct NameContext {
135135
#[allow(dead_code)]
136136
pub(super) name: Option<ast::Name>,
137137
pub(super) kind: NameKind,
@@ -534,9 +534,7 @@ impl<'a> CompletionContext<'a> {
534534
file_with_fake_ident.syntax().token_at_offset(offset).right_biased()?;
535535

536536
let original_token = original_file.syntax().token_at_offset(offset).left_biased()?;
537-
dbg!(&original_token);
538537
let token = sema.descend_into_macros_single(original_token.clone());
539-
dbg!(&token);
540538
let scope = sema.scope_at_offset(&token.parent()?, offset)?;
541539
let krate = scope.krate();
542540
let module = scope.module();

0 commit comments

Comments
 (0)