ttsc 0.7.2 → 0.8.0-dev.20260505

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +5 -5
  2. package/cmd/platform/main.go +86 -76
  3. package/cmd/ttsc/api_compile.go +122 -105
  4. package/cmd/ttsc/api_transform.go +57 -49
  5. package/cmd/ttsc/build.go +116 -103
  6. package/cmd/ttsc/main.go +117 -117
  7. package/cmd/ttsc/main_test.go +191 -191
  8. package/driver/host.go +9 -9
  9. package/driver/program.go +285 -285
  10. package/driver/rewrite.go +266 -219
  11. package/lib/compiler/internal/compileProjectInMemory.js +3 -3
  12. package/lib/compiler/internal/compileProjectInMemory.js.map +1 -1
  13. package/lib/compiler/internal/resolveEmittedJavaScript.js +2 -1
  14. package/lib/compiler/internal/resolveEmittedJavaScript.js.map +1 -1
  15. package/lib/compiler/internal/resolveTsgo.js.map +1 -1
  16. package/lib/compiler/internal/runBuild.js +47 -49
  17. package/lib/compiler/internal/runBuild.js.map +1 -1
  18. package/lib/compiler/internal/transformProjectInMemory.js +44 -4
  19. package/lib/compiler/internal/transformProjectInMemory.js.map +1 -1
  20. package/lib/launcher/internal/getCompilerVersionText.js +1 -2
  21. package/lib/launcher/internal/getCompilerVersionText.js.map +1 -1
  22. package/lib/launcher/internal/prepareExecution.js +6 -4
  23. package/lib/launcher/internal/prepareExecution.js.map +1 -1
  24. package/lib/launcher/internal/runTtsc.js +49 -5
  25. package/lib/launcher/internal/runTtsc.js.map +1 -1
  26. package/lib/launcher/internal/runTtsx.js +7 -2
  27. package/lib/launcher/internal/runTtsx.js.map +1 -1
  28. package/lib/plugin/internal/buildSourcePlugin.js +6 -0
  29. package/lib/plugin/internal/buildSourcePlugin.js.map +1 -1
  30. package/lib/plugin/internal/loadProjectPlugins.js +55 -2
  31. package/lib/plugin/internal/loadProjectPlugins.js.map +1 -1
  32. package/lib/structures/ITtscPlugin.d.ts +19 -3
  33. package/lib/structures/ITtscPlugin.js +4 -0
  34. package/lib/structures/ITtscPlugin.js.map +1 -1
  35. package/lib/structures/TtscPluginStage.d.ts +4 -10
  36. package/lib/structures/internal/ITtscLoadedNativePlugin.d.ts +5 -0
  37. package/package.json +11 -10
  38. package/shim/ast/lint.go +172 -171
  39. package/shim/ast/shim.go +84 -83
  40. package/shim/bundled/shim.go +5 -1
  41. package/shim/checker/shim.go +79 -79
  42. package/shim/compiler/emit_hooks.go +494 -0
  43. package/shim/compiler/shim.go +16 -1
  44. package/shim/core/shim.go +13 -10
  45. package/shim/diagnosticwriter/lint.go +79 -79
  46. package/shim/diagnosticwriter/shim.go +19 -19
  47. package/shim/parser/shim.go +7 -1
  48. package/shim/scanner/shim.go +39 -1
  49. package/shim/tsoptions/shim.go +51 -1
  50. package/shim/tspath/shim.go +72 -1
  51. package/shim/vfs/cachedvfs/shim.go +1 -1
  52. package/shim/vfs/osvfs/shim.go +1 -1
  53. package/shim/vfs/shim.go +4 -1
  54. package/src/compiler/internal/compileProjectInMemory.ts +6 -3
  55. package/src/compiler/internal/resolveEmittedJavaScript.ts +2 -1
  56. package/src/compiler/internal/resolveTsgo.ts +0 -1
  57. package/src/compiler/internal/runBuild.ts +58 -86
  58. package/src/compiler/internal/transformProjectInMemory.ts +51 -6
  59. package/src/launcher/internal/getCompilerVersionText.ts +1 -2
  60. package/src/launcher/internal/prepareExecution.ts +6 -6
  61. package/src/launcher/internal/runTtsc.ts +52 -5
  62. package/src/launcher/internal/runTtsx.ts +16 -5
  63. package/src/plugin/internal/buildSourcePlugin.ts +30 -2
  64. package/src/plugin/internal/loadProjectPlugins.ts +81 -2
  65. package/src/structures/ITtscPlugin.ts +30 -3
  66. package/src/structures/TtscPluginStage.ts +4 -10
  67. package/src/structures/internal/ITtscLoadedNativePlugin.ts +5 -0
  68. package/test/compiler.test.ts +3 -3
  69. package/test/platform.test.ts +1 -3
  70. package/test/tsgo.test.ts +15 -7
  71. package/tools/gen_shims/main.go +409 -409
  72. package/utility/host.go +707 -0
@@ -12,13 +12,13 @@
12
12
  package diagnosticwriter
13
13
 
14
14
  import (
15
- "io"
15
+ "io"
16
16
 
17
- "github.com/microsoft/typescript-go/internal/ast"
18
- "github.com/microsoft/typescript-go/internal/diagnostics"
19
- inner "github.com/microsoft/typescript-go/internal/diagnosticwriter"
20
- "github.com/microsoft/typescript-go/internal/locale"
21
- "github.com/microsoft/typescript-go/internal/tspath"
17
+ "github.com/microsoft/typescript-go/internal/ast"
18
+ "github.com/microsoft/typescript-go/internal/diagnostics"
19
+ inner "github.com/microsoft/typescript-go/internal/diagnosticwriter"
20
+ "github.com/microsoft/typescript-go/internal/locale"
21
+ "github.com/microsoft/typescript-go/internal/tspath"
22
22
  )
23
23
 
24
24
  // LintCategory selects warning vs error rendering. Warnings render yellow,
@@ -26,8 +26,8 @@ import (
26
26
  type LintCategory int
27
27
 
28
28
  const (
29
- LintCategoryWarning LintCategory = iota
30
- LintCategoryError
29
+ LintCategoryWarning LintCategory = iota
30
+ LintCategoryError
31
31
  )
32
32
 
33
33
  // LintDiagnostic is a public, plugin-emittable diagnostic shaped like the
@@ -35,52 +35,52 @@ const (
35
35
  // unexported, so this is the only way to mix lint output with tsgo's own
36
36
  // diagnostics in a single render pass.
37
37
  type LintDiagnostic struct {
38
- file *ast.SourceFile
39
- pos int
40
- end int
41
- code int32
42
- category LintCategory
43
- message string
38
+ file *ast.SourceFile
39
+ pos int
40
+ end int
41
+ code int32
42
+ category LintCategory
43
+ message string
44
44
  }
45
45
 
46
46
  // NewLintDiagnostic builds a lint diagnostic anchored at [pos, end) in the
47
47
  // supplied source file. `code` shows up in the rendered banner — the
48
48
  // convention is to give each rule its own stable integer.
49
49
  func NewLintDiagnostic(file *ast.SourceFile, pos, end int, code int32, category LintCategory, message string) *LintDiagnostic {
50
- if end <= pos {
51
- end = pos + 1
52
- }
53
- return &LintDiagnostic{
54
- file: file,
55
- pos: pos,
56
- end: end,
57
- code: code,
58
- category: category,
59
- message: message,
60
- }
50
+ if end <= pos {
51
+ end = pos + 1
52
+ }
53
+ return &LintDiagnostic{
54
+ file: file,
55
+ pos: pos,
56
+ end: end,
57
+ code: code,
58
+ category: category,
59
+ message: message,
60
+ }
61
61
  }
62
62
 
63
63
  func (d *LintDiagnostic) File() inner.FileLike {
64
- if d == nil || d.file == nil {
65
- return nil
66
- }
67
- return d.file
64
+ if d == nil || d.file == nil {
65
+ return nil
66
+ }
67
+ return d.file
68
68
  }
69
69
 
70
- func (d *LintDiagnostic) Pos() int { return d.pos }
71
- func (d *LintDiagnostic) End() int { return d.end }
72
- func (d *LintDiagnostic) Len() int { return d.end - d.pos }
70
+ func (d *LintDiagnostic) Pos() int { return d.pos }
71
+ func (d *LintDiagnostic) End() int { return d.end }
72
+ func (d *LintDiagnostic) Len() int { return d.end - d.pos }
73
73
  func (d *LintDiagnostic) Code() int32 { return d.code }
74
74
 
75
75
  func (d *LintDiagnostic) Category() diagnostics.Category {
76
- if d.category == LintCategoryError {
77
- return diagnostics.CategoryError
78
- }
79
- return diagnostics.CategoryWarning
76
+ if d.category == LintCategoryError {
77
+ return diagnostics.CategoryError
78
+ }
79
+ return diagnostics.CategoryWarning
80
80
  }
81
81
 
82
- func (d *LintDiagnostic) Localize(_ locale.Locale) string { return d.message }
83
- func (d *LintDiagnostic) MessageChain() []inner.Diagnostic { return nil }
82
+ func (d *LintDiagnostic) Localize(_ locale.Locale) string { return d.message }
83
+ func (d *LintDiagnostic) MessageChain() []inner.Diagnostic { return nil }
84
84
  func (d *LintDiagnostic) RelatedInformation() []inner.Diagnostic { return nil }
85
85
 
86
86
  // IsError reports whether the diagnostic should fail the build. Lint plugins
@@ -92,46 +92,46 @@ func (d *LintDiagnostic) IsError() bool { return d.category == LintCategoryError
92
92
  // `Found N errors` summary. Returns the count of error-level diagnostics so
93
93
  // callers can decide on an exit code.
94
94
  func FormatMixedDiagnostics(
95
- output io.Writer,
96
- astDiags []*ast.Diagnostic,
97
- lintDiags []*LintDiagnostic,
98
- currentDirectory string,
95
+ output io.Writer,
96
+ astDiags []*ast.Diagnostic,
97
+ lintDiags []*LintDiagnostic,
98
+ currentDirectory string,
99
99
  ) int {
100
- if len(astDiags) == 0 && len(lintDiags) == 0 {
101
- return 0
102
- }
103
- all := make([]inner.Diagnostic, 0, len(astDiags)+len(lintDiags))
104
- errors := 0
105
- for _, d := range astDiags {
106
- if d == nil {
107
- continue
108
- }
109
- all = append(all, inner.WrapASTDiagnostic(d))
110
- if d.Category() == diagnostics.CategoryError {
111
- errors++
112
- }
113
- }
114
- for _, d := range lintDiags {
115
- if d == nil {
116
- continue
117
- }
118
- all = append(all, d)
119
- if d.IsError() {
120
- errors++
121
- }
122
- }
123
- if len(all) == 0 {
124
- return 0
125
- }
126
- options := &inner.FormattingOptions{
127
- Locale: locale.Default,
128
- ComparePathsOptions: tspath.ComparePathsOptions{
129
- CurrentDirectory: currentDirectory,
130
- UseCaseSensitiveFileNames: true,
131
- },
132
- NewLine: "\n",
133
- }
134
- inner.FormatDiagnosticsWithColorAndContext(output, all, options)
135
- inner.WriteErrorSummaryText(output, all, options)
136
- return errors
100
+ if len(astDiags) == 0 && len(lintDiags) == 0 {
101
+ return 0
102
+ }
103
+ all := make([]inner.Diagnostic, 0, len(astDiags)+len(lintDiags))
104
+ errors := 0
105
+ for _, d := range astDiags {
106
+ if d == nil {
107
+ continue
108
+ }
109
+ all = append(all, inner.WrapASTDiagnostic(d))
110
+ if d.Category() == diagnostics.CategoryError {
111
+ errors++
112
+ }
113
+ }
114
+ for _, d := range lintDiags {
115
+ if d == nil {
116
+ continue
117
+ }
118
+ all = append(all, d)
119
+ if d.IsError() {
120
+ errors++
121
+ }
122
+ }
123
+ if len(all) == 0 {
124
+ return 0
125
+ }
126
+ options := &inner.FormattingOptions{
127
+ Locale: locale.Default,
128
+ ComparePathsOptions: tspath.ComparePathsOptions{
129
+ CurrentDirectory: currentDirectory,
130
+ UseCaseSensitiveFileNames: true,
131
+ },
132
+ NewLine: "\n",
133
+ }
134
+ inner.FormatDiagnosticsWithColorAndContext(output, all, options)
135
+ inner.WriteErrorSummaryText(output, all, options)
136
+ return errors
137
137
  }
@@ -1,29 +1,29 @@
1
1
  package diagnosticwriter
2
2
 
3
3
  import (
4
- "io"
4
+ "io"
5
5
 
6
- "github.com/microsoft/typescript-go/internal/ast"
7
- inner "github.com/microsoft/typescript-go/internal/diagnosticwriter"
8
- "github.com/microsoft/typescript-go/internal/locale"
9
- "github.com/microsoft/typescript-go/internal/tspath"
6
+ "github.com/microsoft/typescript-go/internal/ast"
7
+ inner "github.com/microsoft/typescript-go/internal/diagnosticwriter"
8
+ "github.com/microsoft/typescript-go/internal/locale"
9
+ "github.com/microsoft/typescript-go/internal/tspath"
10
10
  )
11
11
 
12
12
  // FormatASTDiagnosticsWithColorAndContext writes TypeScript-style pretty
13
13
  // diagnostics using the same internal formatter as typescript-go.
14
14
  func FormatASTDiagnosticsWithColorAndContext(output io.Writer, diagnostics []*ast.Diagnostic, currentDirectory string) {
15
- if len(diagnostics) == 0 {
16
- return
17
- }
18
- formatted := inner.FromASTDiagnostics(diagnostics)
19
- options := &inner.FormattingOptions{
20
- Locale: locale.Default,
21
- ComparePathsOptions: tspath.ComparePathsOptions{
22
- CurrentDirectory: currentDirectory,
23
- UseCaseSensitiveFileNames: true,
24
- },
25
- NewLine: "\n",
26
- }
27
- inner.FormatDiagnosticsWithColorAndContext(output, formatted, options)
28
- inner.WriteErrorSummaryText(output, formatted, options)
15
+ if len(diagnostics) == 0 {
16
+ return
17
+ }
18
+ formatted := inner.FromASTDiagnostics(diagnostics)
19
+ options := &inner.FormattingOptions{
20
+ Locale: locale.Default,
21
+ ComparePathsOptions: tspath.ComparePathsOptions{
22
+ CurrentDirectory: currentDirectory,
23
+ UseCaseSensitiveFileNames: true,
24
+ },
25
+ NewLine: "\n",
26
+ }
27
+ inner.FormatDiagnosticsWithColorAndContext(output, formatted, options)
28
+ inner.WriteErrorSummaryText(output, formatted, options)
29
29
  }
@@ -1,4 +1,3 @@
1
-
2
1
  // Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
3
2
 
4
3
  package parser
@@ -10,7 +9,9 @@ import _ "unsafe"
10
9
 
11
10
  //go:linkname GetJSDocCommentRanges github.com/microsoft/typescript-go/internal/parser.GetJSDocCommentRanges
12
11
  func GetJSDocCommentRanges(f *ast.NodeFactory, commentRanges []ast.CommentRange, node *ast.Node, text string) []ast.CommentRange
12
+
13
13
  type JSDocInfo = parser.JSDocInfo
14
+
14
15
  const PCArgumentExpressions = parser.PCArgumentExpressions
15
16
  const PCArrayBindingElements = parser.PCArrayBindingElements
16
17
  const PCArrayLiteralMembers = parser.PCArrayLiteralMembers
@@ -38,17 +39,22 @@ const PCTypeArguments = parser.PCTypeArguments
38
39
  const PCTypeMembers = parser.PCTypeMembers
39
40
  const PCTypeParameters = parser.PCTypeParameters
40
41
  const PCVariableDeclarations = parser.PCVariableDeclarations
42
+
41
43
  type ParseFlags = parser.ParseFlags
44
+
42
45
  const ParseFlagsAwait = parser.ParseFlagsAwait
43
46
  const ParseFlagsIgnoreMissingOpenBrace = parser.ParseFlagsIgnoreMissingOpenBrace
44
47
  const ParseFlagsJSDoc = parser.ParseFlagsJSDoc
45
48
  const ParseFlagsNone = parser.ParseFlagsNone
46
49
  const ParseFlagsType = parser.ParseFlagsType
47
50
  const ParseFlagsYield = parser.ParseFlagsYield
51
+
48
52
  //go:linkname ParseIsolatedEntityName github.com/microsoft/typescript-go/internal/parser.ParseIsolatedEntityName
49
53
  func ParseIsolatedEntityName(text string) *ast.EntityName
54
+
50
55
  //go:linkname ParseSourceFile github.com/microsoft/typescript-go/internal/parser.ParseSourceFile
51
56
  func ParseSourceFile(opts ast.SourceFileParseOptions, sourceText string, scriptKind core.ScriptKind) *ast.SourceFile
57
+
52
58
  type Parser = parser.Parser
53
59
  type ParserState = parser.ParserState
54
60
  type ParsingContext = parser.ParsingContext
@@ -1,4 +1,3 @@
1
-
2
1
  // Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
3
2
 
4
3
  package scanner
@@ -11,14 +10,19 @@ import _ "unsafe"
11
10
 
12
11
  //go:linkname ComputeLineOfPosition github.com/microsoft/typescript-go/internal/scanner.ComputeLineOfPosition
13
12
  func ComputeLineOfPosition(lineStarts []core.TextPos, pos int) int
13
+
14
14
  //go:linkname ComputePositionOfLineAndByteOffset github.com/microsoft/typescript-go/internal/scanner.ComputePositionOfLineAndByteOffset
15
15
  func ComputePositionOfLineAndByteOffset(lineStarts []core.TextPos, line int, byteOffset int) int
16
+
16
17
  //go:linkname ComputePositionOfLineAndUTF16Character github.com/microsoft/typescript-go/internal/scanner.ComputePositionOfLineAndUTF16Character
17
18
  func ComputePositionOfLineAndUTF16Character(lineStarts []core.TextPos, line int, character core.UTF16Offset, text string, allowEdits bool) int
19
+
18
20
  //go:linkname DeclarationNameToString github.com/microsoft/typescript-go/internal/scanner.DeclarationNameToString
19
21
  func DeclarationNameToString(name *ast.Node) string
22
+
20
23
  type ErrorCallback = scanner.ErrorCallback
21
24
  type EscapeSequenceScanningFlags = scanner.EscapeSequenceScanningFlags
25
+
22
26
  const EscapeSequenceScanningFlagsAllowExtendedUnicodeEscape = scanner.EscapeSequenceScanningFlagsAllowExtendedUnicodeEscape
23
27
  const EscapeSequenceScanningFlagsAnnexB = scanner.EscapeSequenceScanningFlagsAnnexB
24
28
  const EscapeSequenceScanningFlagsAnyUnicodeMode = scanner.EscapeSequenceScanningFlagsAnyUnicodeMode
@@ -27,70 +31,104 @@ const EscapeSequenceScanningFlagsRegularExpression = scanner.EscapeSequenceScann
27
31
  const EscapeSequenceScanningFlagsReportErrors = scanner.EscapeSequenceScanningFlagsReportErrors
28
32
  const EscapeSequenceScanningFlagsReportInvalidEscapeErrors = scanner.EscapeSequenceScanningFlagsReportInvalidEscapeErrors
29
33
  const EscapeSequenceScanningFlagsString = scanner.EscapeSequenceScanningFlagsString
34
+
30
35
  //go:linkname GetECMAEndLinePosition github.com/microsoft/typescript-go/internal/scanner.GetECMAEndLinePosition
31
36
  func GetECMAEndLinePosition(sourceFile *ast.SourceFile, line int) int
37
+
32
38
  //go:linkname GetECMALineAndByteOffsetOfPosition github.com/microsoft/typescript-go/internal/scanner.GetECMALineAndByteOffsetOfPosition
33
39
  func GetECMALineAndByteOffsetOfPosition(sourceFile ast.SourceFileLike, pos int) (line int, byteOffset int)
40
+
34
41
  //go:linkname GetECMALineAndUTF16CharacterOfPosition github.com/microsoft/typescript-go/internal/scanner.GetECMALineAndUTF16CharacterOfPosition
35
42
  func GetECMALineAndUTF16CharacterOfPosition(sourceFile ast.SourceFileLike, pos int) (line int, character core.UTF16Offset)
43
+
36
44
  //go:linkname GetECMALineOfPosition github.com/microsoft/typescript-go/internal/scanner.GetECMALineOfPosition
37
45
  func GetECMALineOfPosition(sourceFile ast.SourceFileLike, pos int) int
46
+
38
47
  //go:linkname GetECMALineStarts github.com/microsoft/typescript-go/internal/scanner.GetECMALineStarts
39
48
  func GetECMALineStarts(sourceFile ast.SourceFileLike) []core.TextPos
49
+
40
50
  //go:linkname GetECMAPositionOfLineAndByteOffset github.com/microsoft/typescript-go/internal/scanner.GetECMAPositionOfLineAndByteOffset
41
51
  func GetECMAPositionOfLineAndByteOffset(sourceFile ast.SourceFileLike, line int, byteOffset int) int
52
+
42
53
  //go:linkname GetECMAPositionOfLineAndUTF16Character github.com/microsoft/typescript-go/internal/scanner.GetECMAPositionOfLineAndUTF16Character
43
54
  func GetECMAPositionOfLineAndUTF16Character(sourceFile ast.SourceFileLike, line int, character core.UTF16Offset) int
55
+
44
56
  //go:linkname GetErrorRangeForNode github.com/microsoft/typescript-go/internal/scanner.GetErrorRangeForNode
45
57
  func GetErrorRangeForNode(sourceFile *ast.SourceFile, node *ast.Node) core.TextRange
58
+
46
59
  //go:linkname GetIdentifierToken github.com/microsoft/typescript-go/internal/scanner.GetIdentifierToken
47
60
  func GetIdentifierToken(str string) ast.Kind
61
+
48
62
  //go:linkname GetLeadingCommentRanges github.com/microsoft/typescript-go/internal/scanner.GetLeadingCommentRanges
49
63
  func GetLeadingCommentRanges(f *ast.NodeFactory, text string, pos int) iter.Seq[ast.CommentRange]
64
+
50
65
  //go:linkname GetRangeOfTokenAtPosition github.com/microsoft/typescript-go/internal/scanner.GetRangeOfTokenAtPosition
51
66
  func GetRangeOfTokenAtPosition(sourceFile *ast.SourceFile, pos int) core.TextRange
67
+
52
68
  //go:linkname GetScannerForSourceFile github.com/microsoft/typescript-go/internal/scanner.GetScannerForSourceFile
53
69
  func GetScannerForSourceFile(sourceFile *ast.SourceFile, pos int) *scanner.Scanner
70
+
54
71
  //go:linkname GetShebang github.com/microsoft/typescript-go/internal/scanner.GetShebang
55
72
  func GetShebang(text string) string
73
+
56
74
  //go:linkname GetSourceTextOfNodeFromSourceFile github.com/microsoft/typescript-go/internal/scanner.GetSourceTextOfNodeFromSourceFile
57
75
  func GetSourceTextOfNodeFromSourceFile(sourceFile *ast.SourceFile, node *ast.Node, includeTrivia bool) string
76
+
58
77
  //go:linkname GetTextOfNode github.com/microsoft/typescript-go/internal/scanner.GetTextOfNode
59
78
  func GetTextOfNode(node *ast.Node) string
79
+
60
80
  //go:linkname GetTextOfNodeFromSourceText github.com/microsoft/typescript-go/internal/scanner.GetTextOfNodeFromSourceText
61
81
  func GetTextOfNodeFromSourceText(sourceText string, node *ast.Node, includeTrivia bool) string
82
+
62
83
  //go:linkname GetTokenPosOfNode github.com/microsoft/typescript-go/internal/scanner.GetTokenPosOfNode
63
84
  func GetTokenPosOfNode(node *ast.Node, sourceFile *ast.SourceFile, includeJSDoc bool) int
85
+
64
86
  //go:linkname GetTrailingCommentRanges github.com/microsoft/typescript-go/internal/scanner.GetTrailingCommentRanges
65
87
  func GetTrailingCommentRanges(f *ast.NodeFactory, text string, pos int) iter.Seq[ast.CommentRange]
88
+
66
89
  //go:linkname GetViableKeywordSuggestions github.com/microsoft/typescript-go/internal/scanner.GetViableKeywordSuggestions
67
90
  func GetViableKeywordSuggestions() []string
91
+
68
92
  //go:linkname IdentifierToKeywordKind github.com/microsoft/typescript-go/internal/scanner.IdentifierToKeywordKind
69
93
  func IdentifierToKeywordKind(node *ast.Identifier) ast.Kind
94
+
70
95
  //go:linkname IsIdentifierPart github.com/microsoft/typescript-go/internal/scanner.IsIdentifierPart
71
96
  func IsIdentifierPart(ch rune) bool
97
+
72
98
  //go:linkname IsIdentifierPartEx github.com/microsoft/typescript-go/internal/scanner.IsIdentifierPartEx
73
99
  func IsIdentifierPartEx(ch rune, languageVariant core.LanguageVariant) bool
100
+
74
101
  //go:linkname IsIdentifierStart github.com/microsoft/typescript-go/internal/scanner.IsIdentifierStart
75
102
  func IsIdentifierStart(ch rune) bool
103
+
76
104
  //go:linkname IsIdentifierText github.com/microsoft/typescript-go/internal/scanner.IsIdentifierText
77
105
  func IsIdentifierText(name string, languageVariant core.LanguageVariant) bool
106
+
78
107
  //go:linkname IsIntrinsicJsxName github.com/microsoft/typescript-go/internal/scanner.IsIntrinsicJsxName
79
108
  func IsIntrinsicJsxName(name string) bool
109
+
80
110
  //go:linkname IsValidIdentifier github.com/microsoft/typescript-go/internal/scanner.IsValidIdentifier
81
111
  func IsValidIdentifier(s string) bool
112
+
82
113
  //go:linkname NewScanner github.com/microsoft/typescript-go/internal/scanner.NewScanner
83
114
  func NewScanner() *scanner.Scanner
115
+
84
116
  //go:linkname ScanTokenAtPosition github.com/microsoft/typescript-go/internal/scanner.ScanTokenAtPosition
85
117
  func ScanTokenAtPosition(sourceFile *ast.SourceFile, pos int) ast.Kind
118
+
86
119
  type Scanner = scanner.Scanner
87
120
  type ScannerState = scanner.ScannerState
121
+
88
122
  //go:linkname SkipTrivia github.com/microsoft/typescript-go/internal/scanner.SkipTrivia
89
123
  func SkipTrivia(text string, pos int) int
124
+
90
125
  //go:linkname SkipTriviaEx github.com/microsoft/typescript-go/internal/scanner.SkipTriviaEx
91
126
  func SkipTriviaEx(text string, pos int, options *scanner.SkipTriviaOptions) int
127
+
92
128
  type SkipTriviaOptions = scanner.SkipTriviaOptions
129
+
93
130
  //go:linkname StringToToken github.com/microsoft/typescript-go/internal/scanner.StringToToken
94
131
  func StringToToken(s string) ast.Kind
132
+
95
133
  //go:linkname TokenToString github.com/microsoft/typescript-go/internal/scanner.TokenToString
96
134
  func TokenToString(token ast.Kind) string
@@ -1,4 +1,3 @@
1
-
2
1
  // Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
3
2
 
4
3
  package tsoptions
@@ -13,12 +12,15 @@ import "reflect"
13
12
  import _ "unsafe"
14
13
 
15
14
  type AlternateModeDiagnostics = tsoptions.AlternateModeDiagnostics
15
+
16
16
  var BuildNameMap = tsoptions.BuildNameMap
17
17
  var BuildOpts = tsoptions.BuildOpts
18
18
  var CommandLineCompilerOptionsMap = tsoptions.CommandLineCompilerOptionsMap
19
+
19
20
  type CommandLineOption = tsoptions.CommandLineOption
20
21
  type CommandLineOptionKind = tsoptions.CommandLineOptionKind
21
22
  type CommandLineOptionNameMap = tsoptions.CommandLineOptionNameMap
23
+
22
24
  const CommandLineOptionTypeBoolean = tsoptions.CommandLineOptionTypeBoolean
23
25
  const CommandLineOptionTypeEnum = tsoptions.CommandLineOptionTypeEnum
24
26
  const CommandLineOptionTypeList = tsoptions.CommandLineOptionTypeList
@@ -26,98 +28,146 @@ const CommandLineOptionTypeListOrElement = tsoptions.CommandLineOptionTypeListOr
26
28
  const CommandLineOptionTypeNumber = tsoptions.CommandLineOptionTypeNumber
27
29
  const CommandLineOptionTypeObject = tsoptions.CommandLineOptionTypeObject
28
30
  const CommandLineOptionTypeString = tsoptions.CommandLineOptionTypeString
31
+
29
32
  var CompilerNameMap = tsoptions.CompilerNameMap
33
+
30
34
  //go:linkname CompilerOptionsAffectDeclarationPath github.com/microsoft/typescript-go/internal/tsoptions.CompilerOptionsAffectDeclarationPath
31
35
  func CompilerOptionsAffectDeclarationPath(oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions) bool
36
+
32
37
  //go:linkname CompilerOptionsAffectEmit github.com/microsoft/typescript-go/internal/tsoptions.CompilerOptionsAffectEmit
33
38
  func CompilerOptionsAffectEmit(oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions) bool
39
+
34
40
  //go:linkname CompilerOptionsAffectSemanticDiagnostics github.com/microsoft/typescript-go/internal/tsoptions.CompilerOptionsAffectSemanticDiagnostics
35
41
  func CompilerOptionsAffectSemanticDiagnostics(oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions) bool
42
+
36
43
  var CompilerOptionsDidYouMeanDiagnostics = tsoptions.CompilerOptionsDidYouMeanDiagnostics
44
+
37
45
  type CompilerOptionsValue = tsoptions.CompilerOptionsValue
46
+
38
47
  //go:linkname ConvertOptionToAbsolutePath github.com/microsoft/typescript-go/internal/tsoptions.ConvertOptionToAbsolutePath
39
48
  func ConvertOptionToAbsolutePath(o string, v any, optionMap tsoptions.CommandLineOptionNameMap, cwd string) (any, bool)
49
+
40
50
  //go:linkname ConvertToTSConfig github.com/microsoft/typescript-go/internal/tsoptions.ConvertToTSConfig
41
51
  func ConvertToTSConfig(configParseResult *tsoptions.ParsedCommandLine, configFileName string) *tsoptions.TSConfig
52
+
42
53
  //go:linkname CreateDiagnosticAtReferenceSyntax github.com/microsoft/typescript-go/internal/tsoptions.CreateDiagnosticAtReferenceSyntax
43
54
  func CreateDiagnosticAtReferenceSyntax(config *tsoptions.ParsedCommandLine, index int, message *diagnostics.Message, args ...any) *ast.Diagnostic
55
+
44
56
  //go:linkname CreateDiagnosticForNodeInSourceFile github.com/microsoft/typescript-go/internal/tsoptions.CreateDiagnosticForNodeInSourceFile
45
57
  func CreateDiagnosticForNodeInSourceFile(sourceFile *ast.SourceFile, node *ast.Node, message *diagnostics.Message, args ...any) *ast.Diagnostic
58
+
46
59
  //go:linkname CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic github.com/microsoft/typescript-go/internal/tsoptions.CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic
47
60
  func CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile *ast.SourceFile, node *ast.Node, message *diagnostics.Message, args ...any) *ast.Diagnostic
61
+
48
62
  type DidYouMeanOptionsDiagnostics = tsoptions.DidYouMeanOptionsDiagnostics
49
63
  type ExtendedConfigCache = tsoptions.ExtendedConfigCache
50
64
  type ExtendedConfigCacheEntry = tsoptions.ExtendedConfigCacheEntry
51
65
  type FileExtensionInfo = tsoptions.FileExtensionInfo
66
+
52
67
  //go:linkname ForEachCompilerOptionValue github.com/microsoft/typescript-go/internal/tsoptions.ForEachCompilerOptionValue
53
68
  func ForEachCompilerOptionValue(options *core.CompilerOptions, declFilter func(*tsoptions.CommandLineOption) bool, fn func(option *tsoptions.CommandLineOption, value reflect.Value, i int) bool) bool
69
+
54
70
  //go:linkname GetCallbackForFindingPropertyAssignmentByValue github.com/microsoft/typescript-go/internal/tsoptions.GetCallbackForFindingPropertyAssignmentByValue
55
71
  func GetCallbackForFindingPropertyAssignmentByValue(value string) func(property *ast.PropertyAssignment) *ast.Node
72
+
56
73
  //go:linkname GetDefaultLibFileName github.com/microsoft/typescript-go/internal/tsoptions.GetDefaultLibFileName
57
74
  func GetDefaultLibFileName(options *core.CompilerOptions) string
75
+
58
76
  //go:linkname GetLibFileName github.com/microsoft/typescript-go/internal/tsoptions.GetLibFileName
59
77
  func GetLibFileName(libName string) (string, bool)
78
+
60
79
  //go:linkname GetNameMapFromList github.com/microsoft/typescript-go/internal/tsoptions.GetNameMapFromList
61
80
  func GetNameMapFromList(optDecls []*tsoptions.CommandLineOption) *tsoptions.NameMap
81
+
62
82
  //go:linkname GetOptionsSyntaxByArrayElementValue github.com/microsoft/typescript-go/internal/tsoptions.GetOptionsSyntaxByArrayElementValue
63
83
  func GetOptionsSyntaxByArrayElementValue(objectLiteral *ast.ObjectLiteralExpression, propKey string, elementValue string) *ast.Node
84
+
64
85
  //go:linkname GetParsedCommandLineOfConfigFile github.com/microsoft/typescript-go/internal/tsoptions.GetParsedCommandLineOfConfigFile
65
86
  func GetParsedCommandLineOfConfigFile(configFileName string, options *core.CompilerOptions, optionsRaw *collections.OrderedMap[string, any], sys tsoptions.ParseConfigHost, extendedConfigCache tsoptions.ExtendedConfigCache) (*tsoptions.ParsedCommandLine, []*ast.Diagnostic)
87
+
66
88
  //go:linkname GetParsedCommandLineOfConfigFilePath github.com/microsoft/typescript-go/internal/tsoptions.GetParsedCommandLineOfConfigFilePath
67
89
  func GetParsedCommandLineOfConfigFilePath(configFileName string, path tspath.Path, options *core.CompilerOptions, optionsRaw *collections.OrderedMap[string, any], sys tsoptions.ParseConfigHost, extendedConfigCache tsoptions.ExtendedConfigCache) (*tsoptions.ParsedCommandLine, []*ast.Diagnostic)
90
+
68
91
  //go:linkname GetSupportedExtensions github.com/microsoft/typescript-go/internal/tsoptions.GetSupportedExtensions
69
92
  func GetSupportedExtensions(compilerOptions *core.CompilerOptions, extraFileExtensions []tsoptions.FileExtensionInfo) [][]string
93
+
70
94
  //go:linkname GetSupportedExtensionsWithJsonIfResolveJsonModule github.com/microsoft/typescript-go/internal/tsoptions.GetSupportedExtensionsWithJsonIfResolveJsonModule
71
95
  func GetSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions *core.CompilerOptions, supportedExtensions [][]string) [][]string
96
+
72
97
  //go:linkname GetTsConfigPropArrayElementValue github.com/microsoft/typescript-go/internal/tsoptions.GetTsConfigPropArrayElementValue
73
98
  func GetTsConfigPropArrayElementValue(tsConfigSourceFile *ast.SourceFile, propKey string, elementValue string) *ast.StringLiteral
99
+
74
100
  var LibFilesSet = tsoptions.LibFilesSet
75
101
  var LibMap = tsoptions.LibMap
76
102
  var Libs = tsoptions.Libs
103
+
77
104
  type NameMap = tsoptions.NameMap
105
+
78
106
  //go:linkname NewParsedCommandLine github.com/microsoft/typescript-go/internal/tsoptions.NewParsedCommandLine
79
107
  func NewParsedCommandLine(compilerOptions *core.CompilerOptions, rootFileNames []string, comparePathsOptions tspath.ComparePathsOptions) *tsoptions.ParsedCommandLine
108
+
80
109
  //go:linkname NewTsconfigSourceFileFromFilePath github.com/microsoft/typescript-go/internal/tsoptions.NewTsconfigSourceFileFromFilePath
81
110
  func NewTsconfigSourceFileFromFilePath(configFileName string, configPath tspath.Path, configSourceText string) *tsoptions.TsConfigSourceFile
111
+
82
112
  var OptionsDeclarations = tsoptions.OptionsDeclarations
83
113
  var OptionsForBuild = tsoptions.OptionsForBuild
84
114
  var OptionsForWatch = tsoptions.OptionsForWatch
115
+
85
116
  //go:linkname ParseBuildCommandLine github.com/microsoft/typescript-go/internal/tsoptions.ParseBuildCommandLine
86
117
  func ParseBuildCommandLine(commandLine []string, host tsoptions.ParseConfigHost) *tsoptions.ParsedBuildCommandLine
118
+
87
119
  //go:linkname ParseBuildOptions github.com/microsoft/typescript-go/internal/tsoptions.ParseBuildOptions
88
120
  func ParseBuildOptions(key string, value any, allOptions *core.BuildOptions) []*ast.Diagnostic
121
+
89
122
  //go:linkname ParseCommandLine github.com/microsoft/typescript-go/internal/tsoptions.ParseCommandLine
90
123
  func ParseCommandLine(commandLine []string, host tsoptions.ParseConfigHost) *tsoptions.ParsedCommandLine
124
+
91
125
  type ParseCommandLineWorkerDiagnostics = tsoptions.ParseCommandLineWorkerDiagnostics
126
+
92
127
  //go:linkname ParseCompilerOptions github.com/microsoft/typescript-go/internal/tsoptions.ParseCompilerOptions
93
128
  func ParseCompilerOptions(key string, value any, allOptions *core.CompilerOptions) []*ast.Diagnostic
129
+
94
130
  //go:linkname ParseConfigFileTextToJson github.com/microsoft/typescript-go/internal/tsoptions.ParseConfigFileTextToJson
95
131
  func ParseConfigFileTextToJson(fileName string, path tspath.Path, jsonText string) (any, []*ast.Diagnostic)
132
+
96
133
  type ParseConfigHost = tsoptions.ParseConfigHost
134
+
97
135
  //go:linkname ParseExtendedConfig github.com/microsoft/typescript-go/internal/tsoptions.ParseExtendedConfig
98
136
  func ParseExtendedConfig(fileName string, path tspath.Path, resolutionStack []string, host tsoptions.ParseConfigHost, extendedConfigCache tsoptions.ExtendedConfigCache) *tsoptions.ExtendedConfigCacheEntry
137
+
99
138
  //go:linkname ParseJsonConfigFileContent github.com/microsoft/typescript-go/internal/tsoptions.ParseJsonConfigFileContent
100
139
  func ParseJsonConfigFileContent(json any, host tsoptions.ParseConfigHost, basePath string, existingOptions *core.CompilerOptions, configFileName string, resolutionStack []tspath.Path, extraFileExtensions []tsoptions.FileExtensionInfo, extendedConfigCache tsoptions.ExtendedConfigCache) *tsoptions.ParsedCommandLine
140
+
101
141
  //go:linkname ParseJsonSourceFileConfigFileContent github.com/microsoft/typescript-go/internal/tsoptions.ParseJsonSourceFileConfigFileContent
102
142
  func ParseJsonSourceFileConfigFileContent(sourceFile *tsoptions.TsConfigSourceFile, host tsoptions.ParseConfigHost, basePath string, existingOptions *core.CompilerOptions, existingOptionsRaw *collections.OrderedMap[string, any], configFileName string, resolutionStack []tspath.Path, extraFileExtensions []tsoptions.FileExtensionInfo, extendedConfigCache tsoptions.ExtendedConfigCache) *tsoptions.ParsedCommandLine
143
+
103
144
  //go:linkname ParseListTypeOption github.com/microsoft/typescript-go/internal/tsoptions.ParseListTypeOption
104
145
  func ParseListTypeOption(opt *tsoptions.CommandLineOption, value string) ([]any, []*ast.Diagnostic)
146
+
105
147
  //go:linkname ParseString github.com/microsoft/typescript-go/internal/tsoptions.ParseString
106
148
  func ParseString(value any) string
149
+
107
150
  //go:linkname ParseStringArray github.com/microsoft/typescript-go/internal/tsoptions.ParseStringArray
108
151
  func ParseStringArray(value any) []string
152
+
109
153
  //go:linkname ParseTristate github.com/microsoft/typescript-go/internal/tsoptions.ParseTristate
110
154
  func ParseTristate(value any) core.Tristate
155
+
111
156
  //go:linkname ParseTypeAcquisition github.com/microsoft/typescript-go/internal/tsoptions.ParseTypeAcquisition
112
157
  func ParseTypeAcquisition(key string, value any, allOptions *core.TypeAcquisition) []*ast.Diagnostic
158
+
113
159
  //go:linkname ParseWatchOptions github.com/microsoft/typescript-go/internal/tsoptions.ParseWatchOptions
114
160
  func ParseWatchOptions(key string, value any, allOptions *core.WatchOptions) []*ast.Diagnostic
161
+
115
162
  type ParsedBuildCommandLine = tsoptions.ParsedBuildCommandLine
116
163
  type ParsedCommandLine = tsoptions.ParsedCommandLine
117
164
  type SourceOutputAndProjectReference = tsoptions.SourceOutputAndProjectReference
118
165
  type TSConfig = tsoptions.TSConfig
166
+
119
167
  //go:linkname TargetToLibMap github.com/microsoft/typescript-go/internal/tsoptions.TargetToLibMap
120
168
  func TargetToLibMap() map[core.ScriptTarget]string
169
+
121
170
  type TsConfigSourceFile = tsoptions.TsConfigSourceFile
171
+
122
172
  var TscBuildOption = tsoptions.TscBuildOption
123
173
  var WatchNameMap = tsoptions.WatchNameMap