Skip to content

Commit 48d79d9

Browse files
authored
move ParsedCommandLine to core (#204)
1 parent 7fa8451 commit 48d79d9

File tree

7 files changed

+31
-13
lines changed

7 files changed

+31
-13
lines changed

internal/compiler/module/resolver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func doCall(t *testing.T, resolver *module.Resolver, call functionCall, skipLoca
355355
if call.args.RedirectedRef != nil {
356356
redirectedReference = &module.ResolvedProjectReference{
357357
SourceFile: (&ast.NodeFactory{}).NewSourceFile("", call.args.RedirectedRef.SourceFile.FileName, nil).AsSourceFile(),
358-
CommandLine: module.ParsedCommandLine{
358+
CommandLine: core.ParsedOptions{
359359
Options: call.args.RedirectedRef.CommandLine.Options,
360360
},
361361
}

internal/compiler/module/types.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,8 @@ type ModeAwareCacheKey struct {
2222
mode core.ResolutionMode
2323
}
2424

25-
type ParsedCommandLine struct {
26-
Options *core.CompilerOptions
27-
}
28-
2925
type ResolvedProjectReference struct {
30-
CommandLine ParsedCommandLine
26+
CommandLine core.ParsedOptions
3127
SourceFile *ast.SourceFile
3228
References []*ResolvedProjectReference
3329
}

internal/compiler/program.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type ProgramOptions struct {
2424
Host CompilerHost
2525
Options *core.CompilerOptions
2626
SingleThreaded bool
27-
ProjectReference []ProjectReference
27+
ProjectReference []core.ProjectReference
2828
DefaultLibraryPath string
2929
}
3030

internal/compiler/types.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,12 +1149,6 @@ var LanguageFeatureMinimumTarget = LanguageFeatureMinimumTargetMap{
11491149
RegularExpressionFlagsUnicodeSets: core.ScriptTargetESNext,
11501150
}
11511151

1152-
type ProjectReference struct {
1153-
path string
1154-
originalPath string
1155-
circular bool
1156-
}
1157-
11581152
type FileIncludeKind int
11591153

11601154
const (

internal/core/parsedoptions.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package core
2+
3+
type ParsedOptions struct {
4+
Options *CompilerOptions
5+
FileNames []string
6+
ProjectReferences []ProjectReference
7+
}

internal/core/projectreference.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package core
2+
3+
type ProjectReference struct {
4+
path string
5+
originalPath string
6+
circular bool
7+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package tsoptions
2+
3+
import (
4+
"github.com/microsoft/typescript-go/internal/ast"
5+
"github.com/microsoft/typescript-go/internal/core"
6+
)
7+
8+
type ParsedCommandLine struct {
9+
Options *core.ParsedOptions
10+
// ConfigFile *ast.SourceFile // used in Program and ExecuteCommandLine
11+
Errors []*ast.Diagnostic
12+
Raw any
13+
CompileOnSave *bool
14+
}

0 commit comments

Comments
 (0)