Skip to content

TypeScript syntax highlighting breaks in case the return type of a function ends with a number #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
egamma opened this issue Apr 24, 2016 · 2 comments

Comments

@egamma
Copy link
Member

egamma commented Apr 24, 2016

From @Lunatix89 on April 23, 2016 14:43

  • VSCode Version: 1.0.0
  • OS Version: Windows 8.1 and Windows 10

Steps to Reproduce:

  1. Create a typescript file
  2. Insert the following code:
import {Vector3, Vector} from 'vectors';

/**
 * A simple 3x3 matrix structure.
 * 
 * @export
 * @class Matrix3x3
 */
class Matrix {
    public M11 : number;
    public M12 : number;
    public M13 : number;
    public M21 : number;
    public M22 : number;
    public M23 : number;
    public M31 : number;
    public M32 : number;
    public M33 : number;


    /**
     * Gets a column as a new vector.
     * 
     * @param {number} index The index of the column (0 .. 2).
     * @returns {Vector3} A vector representing the column.
     */
    public getColumn_Breaks(index : number) : Vector3 {
        if (index == 0) {
            return new Vector3(this.M11, this.M21, this.M31);
        } else if (index == 1) {
            return new Vector3(this.M12, this.M22, this.M32);
        } else if (index == 2) {
            return new Vector3(this.M13, this.M23, this.M33);
        } else {
            throw new RangeError('Invalid matrix 3x3 column index: ' + index);
        }
    }

    /**
     * Gets a column as a new vector.
     * 
     * @param {number} index The index of the column (0 .. 2).
     * @returns {Vector3} A vector representing the column.
     */
    public getColumn_Works(index : number) : Vector {
        if (index == 0) {
            return new Vector(this.M11, this.M21, this.M31);
        } else if (index == 1) {
            return new Vector(this.M12, this.M22, this.M32);
        } else if (index == 2) {
            return new Vector(this.M13, this.M23, this.M33);
        } else {
            throw new RangeError('Invalid matrix 3x3 column index: ' + index);
        }
    }

}

image

Fun fact: Seems even the GitHub highlighter can not handle that specific case :|

image

Copied from original issue: Microsoft/vscode-tslint#46

@egamma
Copy link
Member Author

egamma commented Apr 24, 2016

Moving to Microsoft/TypeScript-TmLanguage for investigation.

@sheetalkamat
Copy link
Member

Fixed by #257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants