lsp-types icon indicating copy to clipboard operation
lsp-types copied to clipboard

impl Default for types that contains deprecated fields

Open oovm opened this issue 2 years ago • 0 comments

When I create lsp_types::document_symbols::DocumentSymbol, I always write an extra line #[allow(deprecated)] to suppress deprecated lint message.

These symbols also have no constructor.

I think we can implement Default for these types, then it can be used like this.

DocumentSymbol {
    name: some_name,
    detail: Some(detail),
    ..Default::default()
}

The only problem is that some fields are difficult to choose default values

oovm avatar Dec 08 '21 10:12 oovm