microsoft / vscode-eslint

VSCode extension to integrate eslint into VSCode
MIT License
1.74k stars 335 forks source link

Feature Request: autocomplete for eslint comment #641

Closed axetroy closed 4 years ago

axetroy commented 5 years ago

2019-03-06 09 53 18 2019-03-06 09 53 49

I am writing an extension that automatically completes these comments.

But I hope that this is implemented by the official extension.

Why do I need this feature?

Because I can't remember the comment of eslint every time.

dbaeumer commented 5 years ago

Nice idea. Are you willing to provide a pull request ?

axetroy commented 5 years ago

@dbaeumer In fact, I have implemented some functions in here https://github.com/axetroy/vscode-comment-autocomplete. ezgif com-video-to-gif

But it still has some problems.

  1. Cannot render correctly in JSX/TSX/VUE
  2. No analysis context, frequent auto-completion.

So, if you have a better solution, I might not create a PR or after I solved the above problem

dbaeumer commented 5 years ago

@axetroy I would actually not create a generic extension for this. I think we are better off to have these in the corresponding linters, prettier extensions.

And you can contribute snippets statically. See https://github.com/Microsoft/vscode/blob/master/extensions/html/package.json#L78 and https://github.com/Microsoft/vscode/blob/master/extensions/html/snippets/html.snippets.json#L1 as an example.

axetroy commented 5 years ago

@dbaeumer Yes, I agree that!

But I am afraid that snippets can't achieve this feature.

eg.

<template>
  <div>
    <!-- eslint-disable -->
  </div>
</template>

<script>
export default {
  date() {
    // eslint-disable
  },
};
</script>

<style>
/* eslint-disable */
</style>

there are 3 comment styles and maybe more.

It's hard to tell how to comment.

this may require using AST to parse the file.

I will not initiate PR until I solve this problem.

If your team has a better way, then just do it.

dbaeumer commented 5 years ago

@axetroy valid point !

dbaeumer commented 4 years ago

I think this is obsolete now that we have quick fixes to add these comments.

I will close the issue.

vscodebot[bot] commented 4 years ago

We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process here. 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!