HaxeFoundation / HaxeFoundation/haxe

Mis-diagnostic of unused import

Open
#10,195 2 comments 0 reactions 0 assignees View on GitHub
bug feature-ide platform-macro
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

In the [SnakeDCI](https://github.com/ciscoheat/SnakeDCI) project, probably due to the heavy macro rewriting that occurs in the [DCI library](https://github.com/ciscoheat/haxedci), when using VS Code, some fields in a class gets marked as unused import:

![2021-03-27 09_13_48-Movement hx - SnakeDCI - Visual Studio Code](https://user-images.githubusercontent.com/130450/112714844-c7be0300-8edc-11eb-9278-2fe80b069641.png)

([code location](https://github.com/ciscoheat/SnakeDCI/blob/master/src/contexts/Movement.hx#L93))

The field `HEAD` is used throughout the class, but it's body is removed and replaced with a generated `MovementHEAD` type, which could cause some confusion. Should the diagnostics even occur for class fields, when the error message says "unused import/using"?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.