Skip to content

Diagnostics should support data field #24682

Closed

Description

  • VSCode Version: 1.11

Since diagnostics are used as a context for the code action provider would be cool if a extension can provide a data field on the diagnostic. It could then annotate a diagnostic as fixable and have an easy computation path for computing code actions. Right now I need to remember hash maps, produce artificial keys, ...

Activity

  1. dbaeumer commented on Apr 13, 2017

    @dbaeumer
    MemberAuthor

    Would allow some further optimization now that we trigger code actions more often.

  2. jrieken commented on Apr 13, 2017

    @jrieken
    Contributor

    yeah, the data key is called code... Unsure if we should overload the Diagnostics-object with that. I understand your desire for simpler programming but from an OO design it might be a little bloated. To me it sounds like you have the perfect use case for WeakMap

  3. added
    under-discussion
    on Apr 13, 2017
  4. dbaeumer commented on Apr 13, 2017

    @dbaeumer
    MemberAuthor

    I am not leaking things in the map. It is just overhead to maintain it in terms of memory and performance. I can't use the code field since I will in the error code. And there is not guarantee in eslint that all errors with the same code are all fixable

  5. jrieken commented on Apr 13, 2017

    @jrieken
    Contributor

    I am not saying you leak but the (coding) overhead will be minimal when using a weak map because there is nothing manage.

  6. added
    *out-of-scope
    on Sep 10, 2018
  7. vscodebot commented on Sep 10, 2018

    @vscodebot

    This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

    If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

    Thanks for your understanding and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*out-of-scopeapilanguages-diagnosticsunder-discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions