VSCode 有办法在标签之间进行选择吗?而且我的意思不仅仅是折叠和取消折叠,我的意思是选择开始标签和结束标签之间的所有内容。


,visual-studio-code"/>

首页 > 解决方案 > VSCode对vim的ci的快捷命令是什么

VSCode 有办法在标签之间进行选择吗?而且我的意思不仅仅是折叠和取消折叠,我的意思是选择开始标签和结束标签之间的所有内容。


问题描述

VSCode 有办法在标签之间进行选择吗?而且我的意思不仅仅是折叠和取消折叠,我的意思是选择开始标签和结束标签之间的所有内容。


查看下面的代码片段,这是一个.net示例:</p>

[ClientSampleMethod]
public WorkItem AddAttachment()
{
    int id = Convert.ToInt32(Context.GetValue<WorkItem>("$newWorkItem3").Id);
    string filePath = ClientSampleHelpers.GetSampleTextFile();

    VssConnection connection = Context.Connection;
    WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient<WorkItemTrackingHttpClient>();

    // upload attachment to store and get a reference to that file
    AttachmentReference attachmentReference = workItemTrackingClient.CreateAttachmentAsync(filePath).Result;

    JsonPatchDocument patchDocument = new JsonPatchDocument();

    patchDocument.Add(
        new JsonPatchOperation()
        {
            Operation = Operation.Test,
            Path = "/rev",
            Value = "1"
        }
    );

    patchDocument.Add(
        new JsonPatchOperation()
        {
            Operation = Operation.Add,
            Path = "/fields/System.History",
            Value = "Adding the necessary spec"
        }
    );

    patchDocument.Add(
        new JsonPatchOperation()
        {
            Operation = Operation.Add,
            Path = "/relations/-",
            Value = new
            {
                rel = "AttachedFile",
                url = attachmentReference.Url,
                attributes = new { comment = "VanDelay Industries - Spec" }
            }
        }
    );

    WorkItem result = workItemTrackingClient.UpdateWorkItemAsync(patchDocument, id).Result;

    return result;
}

您可以在以下链接中获得更多示例:

https://github.com/microsoft/azure-devops-dotnet-samples/blob/main/ClientLibrary/Samples/WorkItemTracking/WorkItemsSample.cs

如果你想使用 REST api,你可以参考附件 - 创建api:

POST https://dev.azure.com/{organization}/{project}/_apis/wit/attachments?fileName={fileName}&uploadType={uploadType}&areaPath={areaPath}&api-version=6.0

标签: visual-studio-code

解决方案


我通过安装 Emmet Keybindings 扩展解决了这个问题: editor.emmet.action.balanceOutward editor.emmet.action.balanceInward


推荐阅读