Bug Report T1234134
Visible to All Users

Code Templates - 'and' gets replaced with '&&' within TypeScript block comments

created 9 months ago

I am using visual studio 2022 with codeRush 23.2.7
Open a TypeScript file (.ts)
add a block comment:
e.g.

TypeScript
/** * This is my comment */

add the word "and" after "comment"

TypeScript
/** * This is my comment and */

-> the word "and" is automatically replaced by "&&"
Hint:
This only occurs on lines that do not contain a slash ( / ) "near its beginning".
e.g.

TypeScript
/* and * This is my comment && */ and
Comments (3)
AE AE
Alex Eg (DevExpress) 9 months ago

    Hello,

    While I am unable to reproduce the issue without the full source code, you can disable 'and' and 'or' templates to avoid unexpected expansions. I attached a video to illustrate how you can do this.

      Thank you Alex,

      your video allowed me to disable the auto-replacement specifically for the words "and" and "or", but these were only examples.
      I don't know the full list of words that are automatically replaced by unwanted terms, but another one is the word "to" that is replaced by
      the word "object".
      The steps to reproduce are quite simple:

      • use any existing project or create a new one (for example, I have created a new empty winform project).
      • add a file named test.ts containing only the following lines
      JavaScript
      /** * typing the word "to" then space: object */

      add a line just before the last one (before the line containing "*/") and just type the word "to", followed by a space:
      -> the word "to" is automatically replaced by "object".
      if you type "to" followed by a space at the end of the line, then "to" is replaced by ": object".

      AE AE
      Alex Eg (DevExpress) 9 months ago

        Hello,

        I reproduced the issue, and we will research it. It looks like there is something wrong with handling the WinForms project along with the .ts file.

        Answers approved by DevExpress Support

        created 9 months ago

        We have addressed the issue described in this ticket and will include a fix in our next maintenance update. Should you need to apply our fix prior to official release, you can request a hotfix here.

        Important Notes:

        • Hotfixes may be unavailable for Early Access/Beta builds or updates set for release within a week.
        • .NET only: in the NuGet Package Manager, use your personal NuGet feed and check the "Include prerelease" option to view the hotfix package in the "Updates" tab.
          Comments (3)
          PW PW
          Przemyslaw Wlodarczak (DevExpress) 9 months ago

            Hi,

            Do you mind if we make this ticket public, so that we can include it in the list of fixed issues for the next release?

              Sure, go ahead.

              PW PW
              Przemyslaw Wlodarczak (DevExpress) 9 months ago

                Thank you!

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.