asyncapi/jasyncapi-idea-plugin

Asyncapi: 3.0.0 .`$ref` has no suggestions/autocomplete and navigation

korifey91 opened this issue · 8 comments

Describe the bug

I'm having a problem with $ref.

Asyncapi 2.6.0 in WebStorm works well, I can see autocomplete\suggestions and navigate to components by clicking on $ref paths.

But with asyncapi: 3.0.0 I can't do the same.

I assume that with 2.6.0 all is fine due to OpenAPI Specifications bundled plugin, but it doesn't support v3.

How to Reproduce

WebStorm info

WebStorm 2023.3.3
Build #WS-233.14015.89, built on January 23, 2024
Runtime version: 17.0.9+7-b1087.11 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.6.3
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
  ide.balloon.shadow.size=0
  debugger.watches.in.variables=false
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.asyncapi.plugin.idea (2.4.0+jre17)
  com.intellij.ideolog (222.3.1.0)
  github.cweijan.test-theme (1.6)
  com.intellij.ml.llm (233.14015.147)
  com.mallowigi (94.1.0)
  mobi.hsz.idea.gitignore (4.5.2)
  com.intellij.mermaid (0.0.19+IJ.232)
  com.intellij.lang.jsgraphql (233.13135.65)
  com.emberjs (2023.3.2)
  ru.adelf.idea.dotenv (2024.1)

Here is the yaml file

asyncapi: 3.0.0
info:
  title: Cool Example
  version: 0.1.0
channels:
  userSignedUp:
    address: user/signedup
    messages:
      userSignedUp:
        description: An event describing that a user just signed up.
        payload:
          type: object
          properties:
            fullName:
              $ref: '#/components/schemas/fullName'
            email:
              type: string
              format: email
            age:
              type: integer
              minimum: 18
operations:
  userSignedUp:
    action: send
    channel:
      $ref: '#/channels/userSignedUp'
components:
  schemas:
    fullName:
      type:
        string

Video

screencast.2024-02-12.10-42-34.mp4

Expected behavior

It is expected that navigation\autocomplete\suggestions work well with v3 as well as with v2.6

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@korifey91 hi!

Can you try to replace ' with "?

Hi @Pakisan !

Thank you! Yes, it works with double quotes.

Is this expected behavior?
I assume that there should be no difference in which quotes to use. Otherwise, some external (which I cannot control) specifications will not work for me, as a WebStorm user.

Hi @Pakisan !

Thank you! Yes, it works with double quotes.

Is this expected behavior?

I assume that there should be no difference in which quotes to use. Otherwise, some external (which I cannot control) specifications will not work for me, as a WebStorm user.

No, it's not expected behavior. Will check IDEA sdk for better method to recognize properly string values in single and double quotes

This bug must not block using of components from others schemas

Hi @Pakisan any updates on this?

There are no autocomplete suggestions for local file references regardless of which quotes I use.

@adammfrank @korifey91 hi! New version is available