Skip to content

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Jun 29, 2020

Adds support for TypeScript code embedded in HTML and Vue files.

There were a number of complications to overcome here:

  • HTML extraction happens in the multi-threaded extraction phase, after the TypeScript compiler has been shut down.
    • I moved HTML extraction first, and made it spit out .ts snippets in the virtual source root, to be extracted during TypeScript extraction.
  • TypeScript must now be able to find files in the virtual source root, and resolve imports in both directions.
  • Source locations for these virtual files must be mapped back to the original file.
  • QLTest uses the old extractor entry point, which doesn't have a notion of a source root or scratch dir, which is needed for testing features that rely on virtual source root. As a short-term solution, it now makes up reasonable values for source root and scratch dir on its own.

Evaluation (bundled with #3833 and #3834) looks uneventful.

Fixes #3730

@asgerf asgerf marked this pull request as ready for review June 30, 2020 12:18
@asgerf asgerf requested a review from a team as a code owner June 30, 2020 12:18
Copy link
Contributor

@erik-krogh erik-krogh left a comment

Choose a reason for hiding this comment

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

Wow, that is a mouthful.

I'll take a final look later, just a small comment for now.

Copy link
Contributor

@erik-krogh erik-krogh left a comment

Choose a reason for hiding this comment

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

The many small commits really helped understand this PR 👍

@asgerf
Copy link
Contributor Author

asgerf commented Jul 2, 2020

Thanks for going through it all @erik-krogh! 👍

@semmle-qlci semmle-qlci merged commit bfb734e into github:master Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

false positive with <script lang="ts"> in *vue
3 participants