mmanela / SnippetDesigner

The Snippet Designer is a plugin which enhances the Visual Studio IDE to allow a richer and more productive code snippet experience.
Apache License 2.0
343 stars 85 forks source link

Please help me see, export, not correct. #161

Closed AtlantisDe closed 3 years ago

AtlantisDe commented 3 years ago

Please help me see, export, not correct.

Code to be exported

        /// <summary>通讯消息示例</summary>
        public static Dot.Net.Common.Engine.Service.Models.ServiceResult FunServiceResult1()
        {
            try
            {

                return ServiceResult.IsSuccess($"操作,完成!");
            }
            catch (Exception ex)
            {
                return ServiceResult.IsFailed($"操作,异常:{ex.Message}");
            }
            finally { }

        }

When used, the code becomes like this

    /// <summary>通讯消息示例</summary>
    public static Dot.Net.Common.Engine.Service.Models.ServiceResult<HttpCommon.Models.ResponseItem> FunServiceResult2()
    {
        try
        {
            var item = new HttpCommon.Models.ResponseItem();

            return ServiceResult<HttpCommon.Models.ResponseItem>.IsSuccess("操作,异常:{ex.Message}", null);
        }
        finally { }

    }

Missing code

the file

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>SR1</Title>
      <Author>
      </Author>
      <Description>
      </Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>SR1</Shortcut>
    </Header>
    <Snippet>
      <Code Language="csharp" Delimiter="$"><![CDATA[        /// <summary>通讯消息示例</summary>
        public static Dot.Net.Common.Engine.Service.Models.ServiceResult FunServiceResult1()
        {
            try
            {

                return ServiceResult.IsSuccess($"操作,完成!");
            }
            catch (Exception ex)
            {
                return ServiceResult.IsFailed($"操作,异常:{ex.Message}");
            }
            finally { }

        }
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

pls help me thanks very much ... it is a bug??

AtlantisDe commented 3 years ago

$$ is worked