Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SourceControlResourceState

An source control resource state represents the state of an underlying workspace resource within a certain source control group.

层级

  • SourceControlResourceState

索引

Properties(4)

Readonly resourceUri

resourceUri: Uri

The Uri of the underlying resource inside the workspace.

Optional Readonly command

command: Command

The Command which should be run when the resource state is open in the Source Control viewlet.

Optional Readonly decorations

The decorations for this source control resource state.

Optional Readonly contextValue

contextValue: string

Context value of the resource state. This can be used to contribute resource specific actions. For example, if a resource is given a context value as diffable. When contributing actions to scm/resourceState/context using menus extension point, you can specify context value for key scmResourceState in when expressions, like scmResourceState == diffable.

    "contributes": {
        "menus": {
            "scm/resourceState/context": [
                {
                    "command": "extension.diff",
                    "when": "scmResourceState == diffable"
                }
            ]
        }
    }

This will show action extension.diff only for resources with contextValue is diffable.

友链:VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场

Generated by TypeDoc. Maintained by 洛竹