I am working on resolving outstanding issues with folder ordering. Under the new system, folders containing some files
with positions and some without trigger warnings. The problem with BracesMatcherFactory instances is that they are
placed at top level: Editors/* or Editors/text/x-java/* etc. But they seem to need to be ordered (at least there was an
ordering attr there before, and the code seems to care: "Find the first provider that accepts the context"). So then all
of the many other files under Editors/* have ambiguous positions relative to them:
Not all children in Editors/ marked with the position attribute: [text, UpToDateStatusProvider, Keybindings,
AnnotationTypes, SideBar, org-netbeans-modules-diff-builtin-visualizer-editable-DiffHighlightsLayerFactory.instance,
Popup, FontsColors, org-netbeans-modules-editor-bracesmatching-BracesMatchHighlighting$Factory.instance,
org-netbeans-modules-editor-impl-highlighting-HLFactory.instance, Toolbars, application], but some are:
Also it looks strange to me for these files to be at top level when almost everything else is in a subdir with a
meaningful name: Popup, SideBar, etc.
Suggest moving org-netbeans-modules-editor-bracesmatching-LegacyEssMatcher.instance and
org-netbeans-modules-editor-bracesmatching-DefaultMatcher.instance into a subdir such as Editors/BracesMatchers or
whatever you like. Experiments confirm that MimeLookup.getLookup(MimePath) does _not_ find them there by default; I
guess you need to create a Class2LayerFolder for BMF?
If you don't have any time and trust me to do it, let me know. It is I think an API change (instances need to be
registered in a different place), but the API is new anyway.
Ok, I'll move them to subfolders. It'll be cleaner.
I'd like to change the way how instances of BracesMatcherFactory are registered in MimeLookup. Currently they are
registered in folders for mime types (eg. Editors/text/x-java). The proposed change is to move them to the
'BracesMatchers' subfolder (eg. Editors/text/x-java/BracesMatchers). As Jesse explained it'll make it easier to maintain
instance files ordering in situations when there is multiple matchers registered for the same mime type (or for the 'all
This is an incompatible change, but the API has not been released yet. I'll update all existing implementations in
Checking in dev/java/editor/src/org/netbeans/modules/java/editor/resources/layer.xml;
/cvs/java/editor/src/org/netbeans/modules/java/editor/resources/layer.xml,v <-- layer.xml
new revision: 1.32; previous revision: 1.31
RCS file: /cvs/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/BMFClass2LayerFolder.java,v
Checking in dev/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/BMFClass2LayerFolder.java;
initial revision: 1.1
Checking in dev/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/layer.xml;
/cvs/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/layer.xml,v <-- layer.xml
new revision: 1.3; previous revision: 1.2
RCS file: /cvs/editor/bracesmatching/src/META-INF/services/org.netbeans.spi.editor.mimelookup.Class2LayerFolder,v
Checking in dev/editor/bracesmatching/src/META-INF/services/org.netbeans.spi.editor.mimelookup.Class2LayerFolder;
initial revision: 1.1
Checking in dev/javadoc/src/org/netbeans/modules/javadoc/resources/mf-layer.xml;
/cvs/javadoc/src/org/netbeans/modules/javadoc/resources/mf-layer.xml,v <-- mf-layer.xml
new revision: 1.65; previous revision: 1.64
forgot to reassign
Jesse, I'm still getting this warning:
[exec] WARNING [org.openide.filesystems.Ordering]: Not all children in / marked with the position attribute:
org-netbeans-modules-editor-java-JavaBracesMatcher.instance], but some are:
The warning is right. LegacyMatcher and DefaultMatcher have the position attribute; they are both registered in
Editors/BracesMatchers (ie. for all languages). Neither JavadocBracesMatcher nor JavaBracesMatcher need the position,
because they are registered for their respective mime types and should automatically have precedence over the matchers
for all languages. Is this something that CompoundFolderChildren should take care of?
Use position="0" for files which you specifically know do not need to be ordered yet are in a folder alongside some
files which do need to be ordered.