获取摩纳哥 Commands/Actions ID 列表?
Get a list of Monaco Commands/Actions IDs?
有没有办法获取摩纳哥可用 commands/actions 及其 ID 的列表,例如 editor.action.formatDocument
?
文档中似乎没有任何内容,我正在努力寻找 VS Code 存储库中已注册的操作和命令。命令面板显示了其中的大部分,但如果您想使用 executeCommand
.
手动调用它们,则不会显示它们的 ID
editor.getSupportedActions()
正是我要找的。
您可以像这样使用它来获取操作 ID 列表:
let actions = editor.getSupportedActions().map((a) => a.id);
console.log(actions);
在我当前的摩纳哥设置中 returns 这样的列表:
[
"actions.find",
"actions.findWithSelection",
"cursorRedo",
"cursorUndo",
"deleteAllLeft",
"deleteAllRight",
"editor.action.addCommentLine",
"editor.action.addCursorsToBottom",
"editor.action.addCursorsToTop",
"editor.action.addSelectionToNextFindMatch",
"editor.action.addSelectionToPreviousFindMatch",
"editor.action.blockComment",
"editor.action.clipboardCopyWithSyntaxHighlightingAction",
"editor.action.commentLine",
"editor.action.copyLinesDownAction",
"editor.action.copyLinesUpAction",
"editor.action.deleteLines",
"editor.action.detectIndentation",
"editor.action.duplicateSelection",
"editor.action.fontZoomIn",
"editor.action.fontZoomOut",
"editor.action.fontZoomReset",
"editor.action.formatDocument",
"editor.action.formatSelection",
"editor.action.gotoLine",
"editor.action.goToReferences",
"editor.action.indentationToSpaces",
"editor.action.indentationToTabs",
"editor.action.indentLines",
"editor.action.indentUsingSpaces",
"editor.action.indentUsingTabs",
"editor.action.inPlaceReplace.down",
"editor.action.inPlaceReplace.up",
"editor.action.insertCursorAbove",
"editor.action.insertCursorAtEndOfEachLineSelected",
"editor.action.insertCursorBelow",
"editor.action.insertLineAfter",
"editor.action.insertLineBefore",
"editor.action.inspectTokens",
"editor.action.joinLines",
"editor.action.jumpToBracket",
"editor.action.marker.next",
"editor.action.marker.nextInFiles",
"editor.action.marker.prev",
"editor.action.marker.prevInFiles",
"editor.action.moveCarretLeftAction",
"editor.action.moveCarretRightAction",
"editor.action.moveLinesDownAction",
"editor.action.moveLinesUpAction",
"editor.action.moveSelectionToNextFindMatch",
"editor.action.moveSelectionToPreviousFindMatch",
"editor.action.nextMatchFindAction",
"editor.action.nextSelectionMatchFindAction",
"editor.action.onTypeRename",
"editor.action.openLink",
"editor.action.outdentLines",
"editor.action.peekDefinition",
"editor.action.previousMatchFindAction",
"editor.action.previousSelectionMatchFindAction",
"editor.action.quickCommand",
"editor.action.quickFix",
"editor.action.quickOutline",
"editor.action.refactor",
"editor.action.referenceSearch.trigger",
"editor.action.reindentlines",
"editor.action.reindentselectedlines",
"editor.action.removeCommentLine",
"editor.action.rename",
"editor.action.revealDefinition",
"editor.action.revealDefinitionAside",
"editor.action.selectHighlights",
"editor.action.selectToBracket",
"editor.action.setSelectionAnchor",
"editor.action.showAccessibilityHelp",
"editor.action.showContextMenu",
"editor.action.showDefinitionPreviewHover",
"editor.action.showHover",
"editor.action.smartSelect.expand",
"editor.action.smartSelect.shrink",
"editor.action.sortLinesAscending",
"editor.action.sortLinesDescending",
"editor.action.sourceAction",
"editor.action.startFindReplaceAction",
"editor.action.toggleHighContrast",
"editor.action.toggleTabFocusMode",
"editor.action.transformToLowercase",
"editor.action.transformToTitlecase",
"editor.action.transformToUppercase",
"editor.action.transpose",
"editor.action.transposeLetters",
"editor.action.triggerParameterHints",
"editor.action.triggerSuggest",
"editor.action.trimTrailingWhitespace",
"editor.action.wordHighlight.trigger",
"editor.fold",
"editor.foldAll",
"editor.foldAllBlockComments",
"editor.foldAllMarkerRegions",
"editor.foldLevel1",
"editor.foldLevel2",
"editor.foldLevel3",
"editor.foldLevel4",
"editor.foldLevel5",
"editor.foldLevel6",
"editor.foldLevel7",
"editor.foldRecursively",
"editor.toggleFold",
"editor.unfold",
"editor.unfoldAll",
"editor.unfoldAllMarkerRegions",
"editor.unfoldRecursively"
]
有没有办法获取摩纳哥可用 commands/actions 及其 ID 的列表,例如 editor.action.formatDocument
?
文档中似乎没有任何内容,我正在努力寻找 VS Code 存储库中已注册的操作和命令。命令面板显示了其中的大部分,但如果您想使用 executeCommand
.
editor.getSupportedActions()
正是我要找的。
您可以像这样使用它来获取操作 ID 列表:
let actions = editor.getSupportedActions().map((a) => a.id);
console.log(actions);
在我当前的摩纳哥设置中 returns 这样的列表:
[
"actions.find",
"actions.findWithSelection",
"cursorRedo",
"cursorUndo",
"deleteAllLeft",
"deleteAllRight",
"editor.action.addCommentLine",
"editor.action.addCursorsToBottom",
"editor.action.addCursorsToTop",
"editor.action.addSelectionToNextFindMatch",
"editor.action.addSelectionToPreviousFindMatch",
"editor.action.blockComment",
"editor.action.clipboardCopyWithSyntaxHighlightingAction",
"editor.action.commentLine",
"editor.action.copyLinesDownAction",
"editor.action.copyLinesUpAction",
"editor.action.deleteLines",
"editor.action.detectIndentation",
"editor.action.duplicateSelection",
"editor.action.fontZoomIn",
"editor.action.fontZoomOut",
"editor.action.fontZoomReset",
"editor.action.formatDocument",
"editor.action.formatSelection",
"editor.action.gotoLine",
"editor.action.goToReferences",
"editor.action.indentationToSpaces",
"editor.action.indentationToTabs",
"editor.action.indentLines",
"editor.action.indentUsingSpaces",
"editor.action.indentUsingTabs",
"editor.action.inPlaceReplace.down",
"editor.action.inPlaceReplace.up",
"editor.action.insertCursorAbove",
"editor.action.insertCursorAtEndOfEachLineSelected",
"editor.action.insertCursorBelow",
"editor.action.insertLineAfter",
"editor.action.insertLineBefore",
"editor.action.inspectTokens",
"editor.action.joinLines",
"editor.action.jumpToBracket",
"editor.action.marker.next",
"editor.action.marker.nextInFiles",
"editor.action.marker.prev",
"editor.action.marker.prevInFiles",
"editor.action.moveCarretLeftAction",
"editor.action.moveCarretRightAction",
"editor.action.moveLinesDownAction",
"editor.action.moveLinesUpAction",
"editor.action.moveSelectionToNextFindMatch",
"editor.action.moveSelectionToPreviousFindMatch",
"editor.action.nextMatchFindAction",
"editor.action.nextSelectionMatchFindAction",
"editor.action.onTypeRename",
"editor.action.openLink",
"editor.action.outdentLines",
"editor.action.peekDefinition",
"editor.action.previousMatchFindAction",
"editor.action.previousSelectionMatchFindAction",
"editor.action.quickCommand",
"editor.action.quickFix",
"editor.action.quickOutline",
"editor.action.refactor",
"editor.action.referenceSearch.trigger",
"editor.action.reindentlines",
"editor.action.reindentselectedlines",
"editor.action.removeCommentLine",
"editor.action.rename",
"editor.action.revealDefinition",
"editor.action.revealDefinitionAside",
"editor.action.selectHighlights",
"editor.action.selectToBracket",
"editor.action.setSelectionAnchor",
"editor.action.showAccessibilityHelp",
"editor.action.showContextMenu",
"editor.action.showDefinitionPreviewHover",
"editor.action.showHover",
"editor.action.smartSelect.expand",
"editor.action.smartSelect.shrink",
"editor.action.sortLinesAscending",
"editor.action.sortLinesDescending",
"editor.action.sourceAction",
"editor.action.startFindReplaceAction",
"editor.action.toggleHighContrast",
"editor.action.toggleTabFocusMode",
"editor.action.transformToLowercase",
"editor.action.transformToTitlecase",
"editor.action.transformToUppercase",
"editor.action.transpose",
"editor.action.transposeLetters",
"editor.action.triggerParameterHints",
"editor.action.triggerSuggest",
"editor.action.trimTrailingWhitespace",
"editor.action.wordHighlight.trigger",
"editor.fold",
"editor.foldAll",
"editor.foldAllBlockComments",
"editor.foldAllMarkerRegions",
"editor.foldLevel1",
"editor.foldLevel2",
"editor.foldLevel3",
"editor.foldLevel4",
"editor.foldLevel5",
"editor.foldLevel6",
"editor.foldLevel7",
"editor.foldRecursively",
"editor.toggleFold",
"editor.unfold",
"editor.unfoldAll",
"editor.unfoldAllMarkerRegions",
"editor.unfoldRecursively"
]