Skip to content

Code completion doesn't work correctly for the first attribute of TSX generic tag #25483

@zhuravlikjb

Description

@zhuravlikjb

TypeScript Version: 3.0.0-dev.20180706

Search Terms:
TSX generic attribute

Code

import * as React from "react";

class Table<P> extends React.Component<P> {
    internalProp: P;
}

type Props = { widthInCol: number; text: string; };

/**
 * @param width {number} Table width in px
 */
function createTable(width) {
    return <Table<Props> {caret} />
}

createTable(800);
  • {caret} is the caret position

Expected behavior:
attributes are shown in code completion

Actual behavior:
"everything" completion is shown

Looks like a specific parsing issue, or just a broken code case not properly handled in code completion handler.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Completion ListsThe issue relates to showing completion lists in an editorDomain: JSX/TSXRelates to the JSX parser and emitter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions