Skip to content
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

Syntax highlighting broken after generic #156

Open
SkyLeite opened this issue Jan 15, 2019 · 4 comments
Open

Syntax highlighting broken after generic #156

SkyLeite opened this issue Jan 15, 2019 · 4 comments

Comments

@SkyLeite
Copy link

SkyLeite commented Jan 15, 2019

Self explanatory.

image

image

Code:

import * as React from "react";
import { Table } from "semantic-ui-react";
import { Example } from "../types";

class AppTable extends React.PureComponent<Props, State> {

    async componentDidMount() {
        const exampleResponse = await fetch("http://localhost:8000/examples");
        if (exampleResponse.status !== 200) {
            return console.error("Dispatch redux error action");
        }

        const examples = await exampleResponse.json();
        this.setState({
            examples
        });
    }
}

type Props = {}
type State = {
    examples: Example[];
}

export default AppTable;
@leafgarland
Copy link
Owner

Thanks for the bug report!

@leafgarland
Copy link
Owner

Hm. I get the same highlighting with or without the generic arguments. Also I don't get any highlighting of the generic arguments, e.g. your screenshot shows different colours for Props and State.

@jcartledge
Copy link

jcartledge commented Aug 12, 2019

I'm experiencing the same issue as the original reporter, but I noticed it works if the filetype is typescript.tsx as opposed to typescript. (This project is not using React or JSX/TSX, it's just plain TypeScript.)

@leahein
Copy link

leahein commented Dec 24, 2019

I'm experiencing the same issue. Syntax highlighting breaks when using generics. This only happens in .ts files, and not in .tsx files.

With generic:
image

Without generic:
image

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

4 participants