Skip to content

Conversation

zhengbli
Copy link
Contributor

@zhengbli zhengbli commented Apr 8, 2016

Fixes #7291 and #7720

* Used to specify the script kind of the file explicitly. It could be one of the following:
* ".ts", ".js", ".tsx", ".jsx"
*/
scriptKindName?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would keep this insync with ScriptKind. so JS, JSX, TS, TSX.

also i would use string literal types, now that we have them instead of string. so:

scriptKindName?: "JS" | "JSX" | "TS" | "TSX";

@mhegazy
Copy link
Contributor

mhegazy commented Apr 19, 2016

👍 with comments on the values of the scriptkind in the protocol.

break;
case "JSX":
scriptKind = ScriptKind.JSX;
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be like scriptKind = ScriptKind[openArgs.scriptKindName] ?

I mean how many places will you need to touch if you create a new ScriptKind? You want to make it less error-prone.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants