Typescript: Format is not working after ¥

Created on 5 Jan 2017  ·  3Comments  ·  Source: microsoft/TypeScript

_From @iou90 on December 15, 2016 8:49_

  • VSCode Version: 1.8
  • OS Version: macOS 10.12.1

Steps to Reproduce:

some React Native codes in index.ios.js:

import React, { Component } from 'react';

import {
  AppRegistry,
  Text,
  View
} from 'react-native';

export default class Test extends Component {
  render() {
    return (
      <View>
        <Text>
          ¥
        </Text>
        <Text>
          {'format is not working after ¥'}
        </Text>
      </View>
    );
  }
}

AppRegistry.registerComponent('Test', () => Test);

_Copied from original issue: Microsoft/vscode#17274_

Bug Formatter JSTSX VS Code Tracked help wanted

Most helpful comment

No longer seems to be happening in TS 3.0.1

All 3 comments

Here's a reduce repo:

function render() {
    return <View>
        ¥
      </View>
}

function x(){}

Format document has no effect.

Replace ¥ with a, and the last line if now correctly formatted as:

function x() { }

Using the above example, I confirmed on the VSCode side that we receive an empty format response (no edits) from the TS server in the ¥ case:

[Trace - 3:06:07 PM] Sending request: format (28). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/sand/test.js",
    "line": 1,
    "offset": 1,
    "endLine": 7,
    "endOffset": 15
}
[Trace - 3:06:07 PM] Response received: format (28). Request took 4 ms. Success: true 
Result: []

No longer seems to be happening in TS 3.0.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fwanicka picture fwanicka  ·  3Comments

kyasbal-1994 picture kyasbal-1994  ·  3Comments

MartynasZilinskas picture MartynasZilinskas  ·  3Comments

weswigham picture weswigham  ·  3Comments

Roam-Cooper picture Roam-Cooper  ·  3Comments