-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: integrate new ParserJS with Spectral #434
feat: integrate new ParserJS with Spectral #434
Conversation
✅ Deploy Preview for modest-rosalind-098b67 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
ccaa62e
to
1371fa5
Compare
Netlify build fails because of asyncapi/parser-js#650 Why our CI didn't fail? 🤔 cc @magicmatatjahu @derberg any idea? |
@magicmatatjahu can you please bump |
c36e682
to
7d64025
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the new error handling! 🔥 And how accurately it highlights the areas that has problems.
Hate the warning system though 😆 As you are entering the realm of governance rules, which highly vary from user to user. I would HATE to see warnings for an arbitrary rule that someone says I should support, for example, Info object must have "contact" object.
, as it's not a requirement from the AsyncAPI spec, but spectral.
For some, this will become highly confusing.
I suggest anything beyond requirements from the spec should be turned off, until (if it's being planned) it's possible to personally select linting rules.
And it makes the editor almost unusable with yellow markings all over 😄 Which almost forces you to take action on the warnings.
@jonaslagoni Thanks for quick review!
Warnings inform you about some good practices and we should enable them by default - it's not treated as error and studio will render html documentation on the right, it's only a info to user that something is a good practice 😄 Of course description of such a warning should be defined as
Yeah, custom rules and overrides are in plan, but probably it will be enabled in next year.
Yeah, I hate it either 😆 so I added suggestion (if you didn't see that) in slack:
So we should underline only errors (by red color) and warning and hints should be displayed in the left panel (where lines number are) as icon - example: https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-rendering-glyphs-in-the-margin check this red square in editor.
We use monaco-editor, this same which VSC uses, so "warnings", "hints" etc are also considering as "problems" - VSC treats every error/waring/hint as problem not "diagnostic" as we do and I don't think so that we can change description of such a warnings. |
I understand that it makes sense to have good practices highlighted, but the matter of the facts is that its only relevant for some users. And it comes down to their use-case and what they would like to see as good practice. If you develop an internal application and use AsyncAPI to describe it and you are a small team, adding contact info makes no sense. ^just an example, sure in some cases it might be, but for small teams or solos, it does not and does nothing but create friction 🙂 If you really want it, I suggest it be added as part of the settings so it can be turned off at the will of the user.
That's understandable 🙂
Hard to say 😆 Cause if you then have to add one for each line where the yellow is currently highlighted, it's also quite a lot still 😄 |
I understand but I don't like such "filtering", because warning contact is indeed unnecessary but for
That icon will be only visible in starting line, so if your object is defined in 20 lines you will only see that icon on first line. |
Just a global one for all warnings I think should be enough, for example,
That would probably make sense then 👍 |
I added vertical lines in the left side of editor (where lines are): Errors are still visible as markers: cc @smoya @jonaslagoni what do you think? |
I would never guess I can modify the diagnostic settings. Imho there should be some icon/link that I can click, and it will open up a setting for me, with a focus on the proper tab. |
@derberg Ok I will do that, thanks for suggestion! |
@derberg Done :) We have gear icon in the diagnostics tab. |
case 1: return ( | ||
<div className='flex flex-row items-center justify-center'> | ||
<VscWarning className='text-yellow-500 w-4 h-4' /> | ||
</div> | ||
); | ||
case 2: return ( | ||
<div className='flex flex-row items-center justify-center'> | ||
<VscInfo className='text-blue-500 w-4 h-4' /> | ||
</div> | ||
); | ||
case 3: return ( | ||
<div className='flex flex-row items-center justify-center'> | ||
<VscLightbulb className='text-green-500 w-4 h-4' /> | ||
</div> | ||
); | ||
default: return ( | ||
<div className='flex flex-row items-center justify-center'> | ||
<VscError className='text-red-500 w-4 h-4' /> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be awesome to have tooltips in these icons. Until I came to the code, I couldn't figure out what the green light bulb meant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works like a charm ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐑 🇮🇹
e034612
to
6193248
Compare
@fmvilas Conflicts are resolved. Could you accept again? |
3741ed9
to
f72b744
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting better but still got UX issues.
|
||
return ( | ||
<ul className='flex flex-row items-center'> | ||
<Tooltip content="Show only errors"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tooltip is great if this option is not selected but when I click on the button it still says "Show only errors", and it's wrong. It should probably say "Show everything" or "Stop showing only errors" or something like that.
That said, playing with these buttons I realized it's acting as a "select" or "option". Wouldn't it make more sense to accept selecting multiple options? For instance, I want to see errors and warnings only. This is a common thing when you're fixing problems and don't want to have much noise. Also, tooltips will become easier. They'd be something like "Show errors" or "Hide errors".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I implemented this second approach with Show all diagnostics
text if user select only one option :) Play with it and you will see what I have in mind. Thanks for suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, by default, all buttons should be checked.
It doesn't have a sense, because then people will need to uncheck three buttons if they will want to see only warnings. I changed state to show messages like:
- buttons are unchecked:
Show only {diagnostic type}
- one button is checked and we hover this checked button:
Show all diagnostics
and for otherShow {diagnostic type}
- for rest:
Show {diagnostic type}
orHide {diagnostic type}
WDYT? :) You can check in preview :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Fair. It's weird that all buttons checked and all buttons unchecked will show you the same thing 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing. I clicked on the Settings cog icon:
And it lets me disable warning, information, and hint messages. In such case, I think we should disable the buttons in this menu too and when you hover over them you'll see a tooltip saying it's been disabled in the settings and that you have to enable them back if you want to use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Fair. It's weird that all buttons checked and all buttons unchecked will show you the same thing 😅
We should leave it as it's now, because people should have option to disable only one particular kind of diagnostics, when you have enabled others. The current solution isn't perfect but by changing it, people may have a worse UX.
And it lets me disable warning, information, and hint messages. In such case, I think we should disable the buttons in this menu too and when you hover over them you'll see a tooltip saying it's been disabled in the settings and that you have to enable them back if you want to use them.
I will add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this is looking much better now 👏
@fmvilas Thanks for review! Could you check again? |
0e6ecbb
to
16d0d01
Compare
16d0d01
to
acc8a2d
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@fmvilas Could you make review again? |
Finally 🚀 Thanks for everyone for review! |
/rtm |
🎉 This PR is included in version 0.14.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
SpecificationService
to handle new parsing behaviour.Settings Modal
- now we can show/hide warnings/info/hint governance issues.Example:
Related issue(s)
Part of asyncapi/parser-js#481