Closed trevor-coleman closed 1 year ago
@trevor-coleman hi, thank you for the request! I thought about it myself, but I wasn't sure if it was annoying or not, and whether we should somehow change it. As far as I understand the purpose of that editor notification is to indicate explicitly that this file is excluded. I can imagine that some users may accidentally exclude some files, for example, using the wrong globe, and they will not be able to understand why something is not working. Also, it's possible to have many configs, and to find the one which excludes this specific file could be hard.
But I agree that if you know what you're doing It becomes annoying and meaningless. I'll look into that. I'd prefer adding a dismiss button for the whole project and possibly resetting this status when the globes were changed.
Describe the bug
I am currently using the
graphql-modules
library, and when writing tests I have to write graphql queries for the test suite to execute. Here is an example from the library docs:These queries are not part of the schema, as they are client-side code, and only used for testing, so I have excluded the folders that contain the tests in my .graphql config file.
However every time I open the file, a notification banner is displayed at the top of the screen that says:
Also, an 'Edit .graphqlconfigblobs' action is added to my Context Actions menu.
The notification is presented in a way that indicates there is an error, and the context menu action has a bright yellow lightbulb icon next to it, which is typically an indicator of something that can improve your code. Because these are displayed in the same way as errors or other important system messages, they can be quite distracting.
I have many of these test files in my project, and I have specifically excluded all of them from the .graphqlconfig. There should be a way to disable these notifications when they aren't useful/necessary.
To Reproduce
Link to Repo with Reproduction or Steps to Reproduce:
Expected behavior
A couple possible solutions to the problem:
//@js-graphql-intellij-plugin-disable-notifications
(Requires parsing the text of the file, and requires something to be added to every file.).graphqlconfig
file.I think I like option 4 the best, becuase it's sensible, and if someone excluded a file in the .graphqlconfig that they probably had a good reason to.
Version and Environment Details
Operation system: Big Sur 11.2.3 IDE name and version: Webstorm 2021.1.3 Plugin version: 2.9.1
Additional context
The notification seems to be generated here.
On line 109 of the method there is a check that looks to see whether a file is included in the .graphqlconfigfile
Maybe there could be a
getClosestExcludingFile()
method ongraphQLConfigManager
that would check for the closest excluding config file: