Author Topic: Is there a way to add JSDoc "@returns" to color formatting?  (Read 1205 times)

mktschudi

  • Community Member
  • Posts: 12
  • Hero Points: 0
Is there a way to add JSDoc "@returns" to color formatting?
« on: September 29, 2022, 06:49:44 PM »
While editing TypeScript or JavaScript, SE formats "@return" as a keyword in a function description. My company uses the alias "@returns", which isn't formatted.  Can you add the alias?  Is there a place for me to patch it in?
Thanks!

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Is there a way to add JSDoc "@returns" to color formatting?
« Reply #1 on: September 30, 2022, 01:07:20 PM »
There is a color coding profile for JavaDoc doc comments where you can add this.

With a javascript file open, go to Document -> Javascript Options, and click on the "Color Coding" entry.   At the top of the Color Coding page, there's a pull down for "Profile".  Click on that, and select JavaDoc.  Now it should show the @keywords for javadoc, and you can click on "Add Words..." to add @returns.  And hit OK, and then @returns should be color coded in JavaDoc for all languages, not just TypeScript.



mktschudi

  • Community Member
  • Posts: 12
  • Hero Points: 0
Re: Is there a way to add JSDoc "@returns" to color formatting?
« Reply #2 on: September 30, 2022, 05:51:55 PM »
Thank you, Patrick!  I understand the options page better now.

One additional step: I needed to re-select the profile for JavaScript after modifying the JavaDoc profile.  Otherwise, my JavaScript file gets formatted as JavaDoc.   :)

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Is there a way to add JSDoc "@returns" to color formatting?
« Reply #3 on: September 30, 2022, 08:52:29 PM »
Ach, I left that out.  Sorry about that, I'm glad you caught that.