Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 19, 2024. It is now read-only.
This repository was archived by the owner on Feb 19, 2024. It is now read-only.

Consider reporting the diagnostics on the nodes that represent the type, not the whole typeof expressions #46

@Rekkonnect

Description

@Rekkonnect

Motivation

For diagnostics emitted in attribute argument syntax nodes that are typeof expressions, the error lies on the types themselves, not the fact that a typeof expression was used. Therefore, semantically it would make more sense to only highlight the type that was used instead of the whole expression.

Another benefit is that it reduces clutter by having smaller chunks of code being highlighted with red squiggles.

Drawbacks

Smaller type names will be harder to distinguish an error on. The main problem would be those with too short names, of up to about 3 letters which seem to be common enough. In a dense document, along with the syntax that generic type arguments come with, users could have a harder time distinguishing where the error is at without resorting to having the IDE navigate them.

Example

Current:

[Attribute(__typeof(int*)__, __typeof(void)__)]

Proposed:

[Attribute(typeof(__int*__), typeof(__void__)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions