Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics should support data field #24682

Closed
dbaeumer opened this issue Apr 13, 2017 · 5 comments
Closed

Diagnostics should support data field #24682

dbaeumer opened this issue Apr 13, 2017 · 5 comments
Assignees
Labels
api languages-diagnostics Source problems reporting *out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach

Comments

@dbaeumer
Copy link
Member

  • 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, ...

@dbaeumer
Copy link
Member Author

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

@jrieken
Copy link
Member

jrieken commented Apr 13, 2017

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

@jrieken jrieken added api under-discussion Issue is under discussion for relevance, priority, approach labels Apr 13, 2017
@dbaeumer
Copy link
Member Author

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

@jrieken
Copy link
Member

jrieken commented Apr 13, 2017

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

@jrieken jrieken added the languages-diagnostics Source problems reporting label Mar 1, 2018
@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Sep 10, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 10, 2018

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!

@vscodebot vscodebot bot closed this as completed Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api languages-diagnostics Source problems reporting *out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

2 participants