Scope Selector for JSON property only


#1

Hi,

I am trying to write a Provider for the autocomplete+ package that can be used with a json file of a specific type (custom file type).

I want the autocomplete to be trigger when the user is writing a property of an object only, however, if I use the Scope Selector: “.source.json .meta.structure.dictionary.json”, then the functionality is also triggered when entering the value for the property (as it is a child) and if I add “.source.json .meta.structure.dictionary.value.json” as the disableForSelector then it won’t trigger at all for any nested properties (as the sub object is a value of the parent property).

Is there anyway that I can write a Scope Selector to only trigger the provider functionality when an object property is written but not triggered for the value?

Any help much appreciated.


#2

Maybe .source.json .meta.structure.dictionary.json:not(.value)?


#3

Thanks @olmokramer but it didn’t seem to work. Still is triggered when either are edited. Any other ideas?


#4

Could you just check the innermost scope when you’re called and return zero results when you’re in a value?