Skip to content

Custom type alias completion priority #20550

@A4-Tacks

Description

@A4-Tacks

How to customize the completion priority of type-alias?

I don't want it to always be located after the struct when completing

fn main() {
    //type Array = [u8; 256];
    struct Array;
    let _: Arr$0;
}

Output completion:

Array Array
ArrayChunks<…>~(use std::iter::ArrayChunks) ArrayChunks<{unknown}, _>
ArrayWindows<…>~(use std::slice::ArrayWindows) ArrayWindows<'_, {unknown}, _>
CharArraySearcher<…>~(use std::str::pattern::CharArraySearcher) CharArraySearcher<'_, _>
CharArrayRefSearcher<…>~(use std::str::pattern::CharArrayRefSearcher) CharArrayRefSearcher<'_, '_, _>
AllocError(use std::alloc::AllocError) AllocError
AccessError(use std::thread::AccessError) AccessError
alloc_error_handler
AddrParseError(use std::net::AddrParseError) AddrParseError
AncillaryError(use std::os::unix::net::AncillaryError) AncillaryError
AtomicOrdering(use std::intrinsics::AtomicOrdering) AtomicOrdering
AsyncIterator(alias Stream) (use std::async_iter::AsyncIterator)
IntoAsyncIterator(use std::async_iter::IntoAsyncIterator)
fn main() {
    type Array = [u8; 256];
    //struct Array;
    let _: Arr$0;
}

Output completion:

ArrayChunks<…>~(use std::iter::ArrayChunks) ArrayChunks<{unknown}, _>
ArrayWindows<…>~(use std::slice::ArrayWindows) ArrayWindows<'_, {unknown}, _>
Array
CharArraySearcher<…>~(use std::str::pattern::CharArraySearcher) CharArraySearcher<'_, _>
CharArrayRefSearcher<…>~(use std::str::pattern::CharArrayRefSearcher) CharArrayRefSearcher<'_, '_, _>
AllocError(use std::alloc::AllocError) AllocError
AccessError(use std::thread::AccessError) AccessError
alloc_error_handler
AddrParseError(use std::net::AddrParseError) AddrParseError
AncillaryError(use std::os::unix::net::AncillaryError) AncillaryError
AtomicOrdering(use std::intrinsics::AtomicOrdering) AtomicOrdering
AsyncIterator(alias Stream) (use std::async_iter::AsyncIterator)
IntoAsyncIterator(use std::async_iter::IntoAsyncIterator)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions