Skip to content

Commit

Permalink
feat(Settings): add option to disable context menus
Browse files Browse the repository at this point in the history
  • Loading branch information
sleistner committed Jan 30, 2023
1 parent 01ab6a4 commit f3b1431
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 110 deletions.
95 changes: 0 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,101 +57,6 @@ will generate the following files

Non-existent folders are created automatically.

## Commands

```json
[
{
"command": "fileutils.renameFile",
"category": "File Utils",
"title": "Rename"
},
{
"command": "fileutils.moveFile",
"category": "File Utils",
"title": "Move"
},
{
"command": "fileutils.duplicateFile",
"category": "File Utils",
"title": "Duplicate"
},
{
"command": "fileutils.removeFile",
"category": "File Utils",
"title": "Delete"
},
{
"command": "fileutils.newFile",
"category": "File Utils",
"title": "New File Relative to Current View"
},
{
"command": "fileutils.newFileAtRoot",
"category": "File Utils",
"title": "New File Relative to Project Root"
},
{
"command": "fileutils.newFolder",
"category": "File Utils",
"title": "New Folder Relative to Current View"
},
{
"command": "fileutils.newFolderAtRoot",
"category": "File Utils",
"title": "New Folder Relative to Project Root"
},
{
"command": "fileutils.copyFileName",
"category": "File Utils",
"title": "Copy Name Of Active File"
}
]
```

## Configuration

```json
{
"fileutils.duplicateFile.typeahead.enabled": {
"type": "boolean",
"default": false,
"description": "Controls whether to show a directory selector for the duplicate file command."
},
"fileutils.moveFile.typeahead.enabled": {
"type": "boolean",
"default": false,
"description": "Controls whether to show a directory selector for the move file command."
},
"fileutils.newFile.typeahead.enabled": {
"type": "boolean",
"default": true,
"description": "Controls whether to show a directory selector for the new file command."
},
"fileutils.newFolder.typeahead.enabled": {
"type": "boolean",
"default": true,
"description": "Controls whether to show a directory selector for new folder command."
},
"fileutils.inputBox.pathType": {
"type": "string",
"default": "root",
"enum": ["root", "workspace"],
"enumDescriptions": [
"Absolute file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace)",
"Relative file path of the opened workspace or folder (e.g. /myWorkspace)"
],
"description": "Controls the path that is shown in the input box."
},
"fileutils.inputBox.pathTypeIndicator": {
"type": "string",
"default": "@",
"maxLength": 50,
"description": "Controls the indicator that is shown in the input box when the path type is workspace. This setting only has an effect when 'fileutils.inputBox.pathType' is set to 'workspace'."
}
}
```

# Changelog

- [https://github.com/sleistner/vscode-fileutils/blob/master/CHANGELOG.md](https://github.com/sleistner/vscode-fileutils/blob/master/CHANGELOG.md)
Expand Down
135 changes: 120 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,67 +96,82 @@
"explorer/context": [
{
"command": "fileutils.moveFile",
"group": "7_modification"
"group": "7_modification",
"when": "config.fileutils.menus.context.explorer =~ /moveFile/"
},
{
"command": "fileutils.duplicateFile",
"group": "7_modification"
"group": "7_modification",
"when": "config.fileutils.menus.context.explorer =~ /duplicateFile/"
},
{
"command": "fileutils.newFileAtRoot",
"group": "2_workspace"
"group": "2_workspace",
"when": "config.fileutils.menus.context.explorer =~ /newFileAtRoot/"
},
{
"command": "fileutils.newFolderAtRoot",
"group": "2_workspace"
"group": "2_workspace",
"when": "config.fileutils.menus.context.explorer =~ /newFolderAtRoot/"
},
{
"command": "fileutils.copyFileName",
"group": "6_copypath"
"group": "6_copypath",
"when": "config.fileutils.menus.context.explorer =~ /copyFileName/"
}
],
"editor/context": [
{
"command": "fileutils.copyFileName",
"group": "1_copypath"
"group": "1_copypath",
"when": "config.fileutils.menus.context.editor =~ /copyFileName/"
},
{
"command": "fileutils.renameFile",
"group": "1_modification@1"
"group": "1_modification@1",
"when": "config.fileutils.menus.context.editor =~ /renameFile/"
},
{
"command": "fileutils.moveFile",
"group": "1_modification@2"
"group": "1_modification@2",
"when": "config.fileutils.menus.context.editor =~ /moveFile/"
},
{
"command": "fileutils.duplicateFile",
"group": "1_modification@3"
"group": "1_modification@3",
"when": "config.fileutils.menus.context.editor =~ /duplicateFile/"
},
{
"command": "fileutils.removeFile",
"group": "1_modification@4"
"group": "1_modification@4",
"when": "config.fileutils.menus.context.editor =~ /removeFile/"
}
],
"editor/title/context": [
{
"command": "fileutils.copyFileName",
"group": "1_copypath"
"group": "1_copypath",
"when": "config.fileutils.menus.context.editorTitle =~ /copyFileName/"
},
{
"command": "fileutils.renameFile",
"group": "1_modification@1"
"group": "1_modification@1",
"when": "config.fileutils.menus.context.editorTitle =~ /renameFile/"
},
{
"command": "fileutils.moveFile",
"group": "1_modification@2"
"group": "1_modification@2",
"when": "config.fileutils.menus.context.editorTitle =~ /moveFile/"
},
{
"command": "fileutils.duplicateFile",
"group": "1_modification@3"
"group": "1_modification@3",
"when": "config.fileutils.menus.context.editorTitle =~ /duplicateFile/"
},
{
"command": "fileutils.removeFile",
"group": "1_modification@4"
"group": "1_modification@4",
"when": "config.fileutils.menus.context.editorTitle =~ /removeFile/"
}
]
},
Expand Down Expand Up @@ -210,6 +225,96 @@
"maxLength": 50,
"description": "Controls the indicator that is shown in the input box when the path type is workspace. This setting only has an effect when 'fileutils.inputBox.pathType' is set to 'workspace'.",
"markdownDescription": "Controls the indicator that is shown in the input box when the path type is workspace. \n\nThis setting only has an effect when `#fileutils.inputBox.pathType#` is set to `workspace`.\n\nFor example, if the path type is `workspace` and the indicator is `@`, the path will be shown as `@/myWorkspace`."
},
"fileutils.menus.context.explorer": {
"type": "array",
"default": [
"moveFile",
"duplicateFile",
"newFileAtRoot",
"newFolderAtRoot",
"copyFileName"
],
"items": {
"type": "string",
"enum": [
"moveFile",
"duplicateFile",
"newFileAtRoot",
"newFolderAtRoot",
"copyFileName"
],
"enumDescriptions": [
"Move",
"Duplicate",
"New File Relative to Project Root",
"New Folder Relative to Project Root",
"Copy Name"
]
},
"uniqueItems": true,
"description": "Controls whether to show the command in the explorer context menu.",
"order": 90
},
"fileutils.menus.context.editor": {
"type": "array",
"default": [
"renameFile",
"moveFile",
"duplicateFile",
"removeFile",
"copyFileName"
],
"items": {
"type": "string",
"enum": [
"renameFile",
"moveFile",
"duplicateFile",
"removeFile",
"copyFileName"
],
"enumDescriptions": [
"Rename",
"Move",
"Duplicate",
"Remove",
"Copy Name"
]
},
"uniqueItems": true,
"description": "Controls whether to show the command in the editor context menu.",
"order": 100
},
"fileutils.menus.context.editorTitle": {
"type": "array",
"default": [
"renameFile",
"moveFile",
"duplicateFile",
"removeFile",
"copyFileName"
],
"items": {
"type": "string",
"enum": [
"renameFile",
"moveFile",
"duplicateFile",
"removeFile",
"copyFileName"
],
"enumDescriptions": [
"Rename",
"Move",
"Duplicate",
"Remove",
"Copy Name"
]
},
"uniqueItems": true,
"description": "Controls whether to show the command in the editor title context menu.",
"order": 110
}
}
}
Expand Down

0 comments on commit f3b1431

Please sign in to comment.