Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-12857

Syntax highlighting is incorrect for certain JavaScript use cases

XMLWordPrintable

      Issue Summary

      For certain use cases of JavaScript, the syntax highlighting that is used when displaying the source of .js files is incorrect.

      Steps to Reproduce

      1. Have a .js file with the following content
        public something(callback: callback, options?: ConsumerOptions): Promise<Consumer> {
        	console.info(`[${this.constructor.name}] Consumer creating.`);
        
        	this.consumer = Consumer.create({
        		...options,
        		queueUrl: await this.getUrl(),
        		handleMessage: message => {
        			if (message.Body){
        				message.Body = JSON.parse(message.Body);
        			}
        		}
        	})
        }
        
      2. View the file in source view

      Expected Results

      The syntax is highlighted consistently, something like this way:

      Actual Results

      The syntax is highlighted incorrectly:

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

        1. Screenshot 2021-05-14 at 11.43.52.png
          50 kB
          Christian Glockner
        2. Screenshot 2021-05-14 at 11.45.06.png
          53 kB
          Christian Glockner
        3. typescript-mode-highlighting.png
          43 kB
          John van der Loo
        4. ts-highlighting-in-js.png
          405 kB
          John van der Loo

              Unassigned Unassigned
              cglockner Christian Glockner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: