Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl Default for types that contains deprecated fields #226

Open
oovm opened this issue Dec 8, 2021 · 0 comments
Open

impl Default for types that contains deprecated fields #226

oovm opened this issue Dec 8, 2021 · 0 comments

Comments

@oovm
Copy link

oovm commented Dec 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant