Skip to content

Commit e0864c9

Browse files
bors[bot]matklad
andauthored
Merge #8950
8950: minor: align import style with styleguide r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 1605488 + 8d5f59e commit e0864c9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

crates/ide_db/src/ty_filter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use std::iter;
66

7-
use hir::{Adt, Semantics, Type};
7+
use hir::Semantics;
88
use syntax::ast::{self, make};
99

1010
use crate::RootDatabase;
@@ -20,9 +20,9 @@ impl TryEnum {
2020
const ALL: [TryEnum; 2] = [TryEnum::Option, TryEnum::Result];
2121

2222
/// Returns `Some(..)` if the provided type is an enum that implements `std::ops::Try`.
23-
pub fn from_ty(sema: &Semantics<RootDatabase>, ty: &Type) -> Option<TryEnum> {
23+
pub fn from_ty(sema: &Semantics<RootDatabase>, ty: &hir::Type) -> Option<TryEnum> {
2424
let enum_ = match ty.as_adt() {
25-
Some(Adt::Enum(it)) => it,
25+
Some(hir::Adt::Enum(it)) => it,
2626
_ => return None,
2727
};
2828
TryEnum::ALL.iter().find_map(|&var| {

editors/code/src/snippets.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export async function applySnippetTextEdits(editor: vscode.TextEditor, edits: vs
5656
}
5757
});
5858
if (selections.length > 0) editor.selections = selections;
59+
if (selections.length === 1) {
60+
editor.revealRange(selections[0], vscode.TextEditorRevealType.InCenterIfOutsideViewport);
61+
}
5962
}
6063

6164
function parseSnippet(snip: string): [string, [number, number]] | undefined {

0 commit comments

Comments
 (0)