SchwarzIT / spectral-intellij-plugin

IntelliJ plugin for continuous OpenAPI linting using the Spectral OpenAPI linter
Apache License 2.0
19 stars 6 forks source link

Multiple path patterns separated by new line break the plugin #114

Open mimkorn opened 1 year ago

mimkorn commented 1 year ago

Build #IU-232.10203.10, built on October 24, 2023

In the following GIF https://share.cleanshot.com/gGlty03m you can see that Spectral is installed, it is accessible in terminal anywhere with "spectral" command and it properly returns warnings in terminal, but no problems are shown in the IDEa for the same file. I quadruple-checked everything is correct and it doesn't work.

I found no spectral related errors in IntelliJ IDEa logs, nor any hints in the interface.

edit: edited the name to reflect the root cause as identified by @rkovarik below

rkovarik commented 12 months ago

I had to go to Preferences -> Tools -> Spectral -> Included path patterns and change it to: */openapi.yaml (remove other lines). After closing and reopening openapi.yaml, it picked up the changes and showed the problems.

quadrrem commented 10 months ago

I have the same problem with IntelliJ IDEA 2023.3.2 (Build #IU-233.13135.103, built on December 20, 2023) and plugin version 3.0.1.

The fix of @rkovarik solved the issue

AlexKotsc commented 8 months ago

It seems that the newlines in the settings window get stored as 
 in the spectral.xml settings file. This is not being parsed correctly by kotlins .lines() method.

Maybe serialize them using XCollection? https://github.com/JetBrains/intellij-community/blob/master/platform/util/src/com/intellij/util/xmlb/annotations/XCollection.java