wso2/jaggery

IntelliJ plugin does not recognize JSDoc's `@typedef`

Opened this issue · 2 comments

Description:
When using the IntelliJ plugin, and defining types using JSDoc's @typedef, usages of the defined types display "unresolved variable or type" warnings.

I'm posting this here because I've been unable so far to find the IntelliJ plugin's source repo - please let me know if there's a better place to log this issue.

OS, DB, other environment details and versions:
IntelliJ IDEA 2019.1.2 (Ultimate Edition)
Build #IU-191.7141.44, built on May 7, 2019
JRE: 1.8.0_202-release-1483-b49 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

Steps to reproduce:

  • Install the IntelliJ Jaggery plugin
  • open a project which uses Jaggery in IntelliJ
  • paste in the code below
/**
 * @typedef {Object} AppBadgeInfo
 * @property {string} appName
 * @property {string} url
 */

/**
 * Extract the url from description text. where url will be between two $ signs
 * @return {AppBadgeInfo} application info for a badge
 */
function getAppInfo(app) {
  return {appName: 'hello', url: 'world'};
}

Intellij is not open source - you can report bugs and get support at https://intellij-support.jetbrains.com

Adding a @type line works for me:

/**
 * @typedef {Object} AppBadgeInfo
 * @type {Object}
 * @property {string} appName
 * @property {string} url
 */

This refers to the Jaggery plugin specifically not supporting this correctly, not an overall issue in IntelliJ. As I recall it was behaving fine in javascript files. I'm not using WSO2 or IntelliJ at my current position, so I'm not really able to go back and check