Skip to content

Trying to find how code is highlighted for warnings... #1

@carlca

Description

@carlca

Consider this mojo code...

Image

Functionally, both pairs of lines behave in the same way, only the first pair of lines have this ugly underline because the compiler thinks that the final call to background_color is causing an unused variable warning, because the fluent nature of the API requires each call made to a fn in Colors to return another instance reference of Color, thus allowing commands to be chained.

See how the highlighting is avoided in the second pair of lines by assigning the "unused variable" to a no-op variable _ =. I've searched though the Zed source code, and through your mz source code, but I cannot figure out how to disable this wavy, yellow line. I can check for warnings when I build from the command line; I don't need the editor to do it for me as I code... it's really distracting 😉

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions