|
154 | 154 | </foldingReconcilingStrategy> |
155 | 155 | </extension> |
156 | 156 |
|
| 157 | + <!-- folding: define commands --> |
| 158 | + <extension point="org.eclipse.ui.commands"> |
| 159 | + <command |
| 160 | + categoryId="org.eclipse.lsp4e.category" |
| 161 | + id="org.eclipse.lsp4e.folding.collapseAll" |
| 162 | + name="%command.folding.foldAll.name" /> |
| 163 | + <command |
| 164 | + categoryId="org.eclipse.lsp4e.category" |
| 165 | + id="org.eclipse.lsp4e.folding.expandAll" |
| 166 | + name="%command.folding.unfoldAll.name" /> |
| 167 | + </extension> |
| 168 | + |
| 169 | + <!-- folding: register command handlers --> |
| 170 | + <extension point="org.eclipse.ui.handlers"> |
| 171 | + <handler |
| 172 | + class="org.eclipse.lsp4e.operations.folding.FoldAllHandler" |
| 173 | + commandId="org.eclipse.lsp4e.folding.collapseAll"> |
| 174 | + <activeWhen> |
| 175 | + <or> |
| 176 | + <reference definitionId="org.eclipse.lsp4e.textSelectionHasLanguageServer" /> |
| 177 | + <reference definitionId="org.eclipse.lsp4e.editorHasLanguageServer" /> |
| 178 | + </or> |
| 179 | + </activeWhen> |
| 180 | + </handler> |
| 181 | + <handler |
| 182 | + class="org.eclipse.lsp4e.operations.folding.UnfoldAllHandler" |
| 183 | + commandId="org.eclipse.lsp4e.folding.expandAll"> |
| 184 | + <activeWhen> |
| 185 | + <or> |
| 186 | + <reference definitionId="org.eclipse.lsp4e.textSelectionHasLanguageServer" /> |
| 187 | + <reference definitionId="org.eclipse.lsp4e.editorHasLanguageServer" /> |
| 188 | + </or> |
| 189 | + </activeWhen> |
| 190 | + </handler> |
| 191 | + </extension> |
| 192 | + |
| 193 | + <!-- folding: register menu entries --> |
| 194 | + <extension point="org.eclipse.ui.menus"> |
| 195 | + <menuContribution |
| 196 | + allPopups="true" |
| 197 | + locationURI="popup:org.eclipse.ui.genericeditor.source.menu?after=additions"> |
| 198 | + <separator name="org.eclipse.lsp4e.folding.group.start" visible="true"/> |
| 199 | + <command commandId="org.eclipse.lsp4e.folding.collapseAll" label="%command.folding.foldAll.name"> |
| 200 | + <visibleWhen> |
| 201 | + <reference definitionId="org.eclipse.lsp4e.textSelectionHasLanguageServer" /> |
| 202 | + </visibleWhen> |
| 203 | + </command> |
| 204 | + <command commandId="org.eclipse.lsp4e.folding.expandAll" label="%command.folding.unfoldAll.name"> |
| 205 | + <visibleWhen> |
| 206 | + <reference definitionId="org.eclipse.lsp4e.textSelectionHasLanguageServer" /> |
| 207 | + </visibleWhen> |
| 208 | + </command> |
| 209 | + <separator name="org.eclipse.lsp4e.folding.group.end" visible="true"/> |
| 210 | + </menuContribution> |
| 211 | + </extension> |
| 212 | + |
| 213 | + <!-- folding: add commands to main Window > Source menu contributed by TM4E --> |
| 214 | + <extension point="org.eclipse.ui.menus"> |
| 215 | + <menuContribution locationURI="menu:org.eclipse.tm4e.source.menu?after=additions"> |
| 216 | + <separator name="org.eclipse.lsp4e.folding.main.group.start" visible="true"/> |
| 217 | + <command commandId="org.eclipse.lsp4e.folding.collapseAll" label="%command.folding.foldAll.name"> |
| 218 | + <visibleWhen> |
| 219 | + <or> |
| 220 | + <with variable="activeEditorInput"> |
| 221 | + <test property="org.eclipse.lsp4e.hasLanguageServer" /> |
| 222 | + </with> |
| 223 | + <with variable="activeEditor"> |
| 224 | + <test property="org.eclipse.lsp4e.hasLanguageServer" /> |
| 225 | + </with> |
| 226 | + </or> |
| 227 | + </visibleWhen> |
| 228 | + </command> |
| 229 | + <command commandId="org.eclipse.lsp4e.folding.expandAll" label="%command.folding.unfoldAll.name"> |
| 230 | + <visibleWhen> |
| 231 | + <or> |
| 232 | + <with variable="activeEditorInput"> |
| 233 | + <test property="org.eclipse.lsp4e.hasLanguageServer" /> |
| 234 | + </with> |
| 235 | + <with variable="activeEditor"> |
| 236 | + <test property="org.eclipse.lsp4e.hasLanguageServer" /> |
| 237 | + </with> |
| 238 | + </or> |
| 239 | + </visibleWhen> |
| 240 | + </command> |
| 241 | + <separator name="org.eclipse.lsp4e.folding.main.group.end" visible="true"/> |
| 242 | + </menuContribution> |
| 243 | + </extension> |
| 244 | + |
| 245 | + <!-- folding: key bindings --> |
| 246 | + <extension point="org.eclipse.ui.bindings"> |
| 247 | + <key sequence="M1+M2+NUMPAD_DIVIDE" |
| 248 | + commandId="org.eclipse.lsp4e.folding.collapseAll" |
| 249 | + contextId="org.eclipse.ui.genericeditor.genericEditorContext" |
| 250 | + schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" /> |
| 251 | + <key sequence="M1+M2+NUMPAD_MULTIPLY" |
| 252 | + commandId="org.eclipse.lsp4e.folding.expandAll" |
| 253 | + contextId="org.eclipse.ui.genericeditor.genericEditorContext" |
| 254 | + schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" /> |
| 255 | + </extension> |
| 256 | + |
157 | 257 |
|
158 | 258 | <!-- ===================================== --> |
159 | 259 | <!-- Find References Support --> |
|
464 | 564 | contentType="org.eclipse.core.runtime.text"> |
465 | 565 | <enabledWhen> |
466 | 566 | <reference definitionId="org.eclipse.lsp4e.editorHasLanguageServer" /> |
467 | | - </enabledWhen> |
| 567 | + </enabledWhen> |
468 | 568 | </reconcilingStrategy> |
469 | 569 | </extension> |
470 | 570 |
|
|
0 commit comments