Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -41,7 +42,7 @@ public class Main {
* A version identifier that should be updated every time the extractor changes in such a way that
* it may produce different tuples for the same file under the same {@link ExtractorConfig}.
*/
public static final String EXTRACTOR_VERSION = "2025-01-09";
public static final String EXTRACTOR_VERSION = "2025-01-21";

public static final Pattern NEWLINE = Pattern.compile("\n");

Expand Down Expand Up @@ -179,6 +180,12 @@ public void run(String[] args) {
remainingTypescriptFiles.add(f);
}
}
for (Map.Entry<Path, FileSnippet> entry : extractorState.getSnippets().entrySet()) {
if (!extractedFiles.contains(entry.getKey().toFile())
&& FileType.forFileExtension(entry.getKey().toFile()) == FileType.TYPESCRIPT) {
remainingTypescriptFiles.add(entry.getKey().toFile());
}
}
if (!remainingTypescriptFiles.isEmpty()) {
tsParser.prepareFiles(remainingTypescriptFiles);
for (File f : remainingTypescriptFiles) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: fix
---
* Fixed a bug that would occur when TypeScript code was found in an HTML-like file, such as a `.vue` file,
but where it could not be associated with any `tsconfig.json` file. Previously the embedded code was not
extracted in this case, but should now be extracted properly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<p v-html="input" />
</template>
<script setup lang="ts">
console.log("hello");
</script>
<style></style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| embedded-typescript.vue:5:1:6:0 | <toplevel> |
| test.js:1:1:2:0 | <toplevel> |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("hello");
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import javascript

query predicate toplevels(TopLevel top) { any() }