Skip to content
This repository has been 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

Open
Rekkonnect opened this issue Aug 5, 2021 · 0 comments
Labels
good first issue Good for newcomers question Further information is requested

Comments

@Rekkonnect
Copy link
Owner

Rekkonnect commented Aug 5, 2021

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__)]
@Rekkonnect Rekkonnect added the question Further information is requested label Aug 5, 2021
@Rekkonnect Rekkonnect added this to the Future milestone Aug 5, 2021
@Rekkonnect Rekkonnect added the good first issue Good for newcomers label Aug 5, 2021
@Rekkonnect Rekkonnect modified the milestones: Future, 1.4 Apr 4, 2022
@Rekkonnect Rekkonnect removed this from the 1.4 milestone Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant