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

@todo and @async tags are not highlighted in a JSDoc comment block #493

Open
viniciussbs opened this issue Apr 18, 2018 · 9 comments
Open

Comments

@viniciussbs
Copy link

viniciussbs commented Apr 18, 2018

Hi! The @todo tag and @async tag are not highlighted in a JSDoc comment block like other tags are. Could they be included into the list of supported tags?

@viniciussbs viniciussbs changed the title @todo tag is not highlighted in a JSDoc comment block @todo and @async tags are not highlighted in a JSDoc comment block Apr 18, 2018
@JeremyPouyet
Copy link

Many other tags are not highlighted like @file and @overview which are synonyms to @fileoverview. The detected tag list is clearly incomplete and needs to be updated with the entire tag set.

In js2-mode.el, lines 6835 to 6939, their is the list of detected tags. I've tried to add @file and @overview in the regexp js2-jsdoc-empty-tag-regexp but it didn't change anything in emacs :( I'm a beginner with emacs so I may have forgot to do something to reload the module for the example.

Any idea of how to update the tag set ?

@orzechowskid
Copy link

Any idea of how to update the tag set ?

M-x byte-compile-file maybe?

I took a crack at updating and re-ordering some of the JSDoc tags based on what's enumerated on http://usejsdoc.org/index.html , because I too just noticed this behavior with @async and @todo. There were some tags already in js2-mode.el which I did not see on usejsdoc.org and did not recognize; those were left alone.

diff: orzechowskid@ad9575e

If there's interest in me opening a PR, then I will gladly sign the release form and do so.

@ArneBab
Copy link
Contributor

ArneBab commented Apr 28, 2021

In my current install I see the added regexp-opt — was your change merged (so this issue could be closed)?

@dgutov
Copy link
Collaborator

dgutov commented Apr 28, 2021

@ArneBab Still no "async" or "todo" tags in master.

@orzechowskid PR welcome, sure.

@trev-dev
Copy link

trev-dev commented Mar 2, 2022

Some of these missing tags are buggin' me too. I've got it patched on my end. When I get some time I'd like to go over the JSDoc3 tag list and update js2-mode in a more complete way than just the "one or two tags I feel like I'm missing."

Some non JSDoc tags that I'd also like to add are weirder ones like "@template" for describing generics to the TypeScript language server without the use of TypeScript. Is it OK if I do that?

@ArneBab
Copy link
Contributor

ArneBab commented Mar 2, 2022

Is there a way to use js2 for Typescript? At work we’re migrating there and the ts-lsp and tide-mode just don’t have the same performance as js2-mode.

@trev-dev
Copy link

trev-dev commented Mar 3, 2022

Is there a way to use js2 for Typescript? At work we’re migrating there and the ts-lsp and tide-mode just don’t have the same performance as js2-mode.

You could just use typescript.el + lsp-mode with the typescript language server. Works well for me.

https://github.com/emacs-typescript/typescript.el
https://emacs-lsp.github.io/lsp-mode/page/languages/

@dgutov
Copy link
Collaborator

dgutov commented Mar 3, 2022

There was a project to extend js2-mode to support Flow, but it's stalled: https://github.com/Fuco1/flow-js2-mode

There's nothing comparable for TS, to my knowledge.

@dgutov
Copy link
Collaborator

dgutov commented Mar 3, 2022

Some non JSDoc tags that I'd also like to add are weirder ones like "https://github.com/template" for describing generics to the TypeScript language server without the use of TypeScript. Is it OK if I do that?

I guess so. You could add a separate regexp for them, like js2-jsdoc-typed-tag-regexp and etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants