Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Conversation

@joshvera
Copy link
Contributor

@joshvera joshvera commented Jun 6, 2019

In tree-sitter/tree-sitter-typescript#68, we separated the TSX and TypeScript syntax in order to support type arguments in TSX and avoid ambiguity.

This PR adds a new assignment to semantic and moves JSX, TSX, and JavaScript to this new parser/assignment in order to assign more precisely. In practice this means type assertions are no longer supported in Flow/JS and JSX fragments are no longer parsed in TypeScript.

@joshvera joshvera marked this pull request as ready for review June 6, 2019 22:05
Copy link
Contributor Author

@joshvera joshvera left a comment

Choose a reason for hiding this comment

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

Ready for review.

super,
object,
array,
jsxElement',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've had to duplicate typescript assignment in order to leave jsxElement' and jsxFragment in here. I could move assignment out into some Common module and pass in a list of terms to mappend instead. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for calling out the duplication. Given the size of this patch as it is, I'd be in favor of merging this and to extract a common assignment module as a follow up PR. That might also make a weightier issue for someone in the community to take on. Either way I'm 👍

Copy link
Contributor

@rewinfrey rewinfrey left a comment

Choose a reason for hiding this comment

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

👍 looks good to me! I left a couple questions.

super,
object,
array,
jsxElement',
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for calling out the duplication. Given the size of this patch as it is, I'd be in favor of merging this and to extract a common assignment module as a follow up PR. That might also make a weightier issue for someone in the community to take on. Either way I'm 👍

typescriptExtensions = ["ts", "tsx", "d.ts"]

javascriptExtensions :: [String]
javascriptExtensions = ["js"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there differences between this Resolution module and TypeScript.Resolution? I'm curious if we can still maintain a single Resolution module for TypeScript and TSX?

, le "ruby" ".rb" "examples" (Just "script/known_failures.txt")
, le "typescript" ".ts" "examples" (Just "script/known_failures.txt")
, le "typescript" ".ts" "examples" (Just "typescript/script/known_failures.txt")
, le "typescript" ".tsx" "examples" (Just "typescript/script/known_failures.txt")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with this context, but is "typescript" as the language correct here rather than "tsx"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah "typescript" refers to the directory the example repos are in. This adds about 150 tests to parse-examples.

@joshvera joshvera merged commit 933ab87 into master Jun 7, 2019
@joshvera joshvera deleted the typescript-mapped-types branch June 7, 2019 17:21
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.

3 participants