Skip to content

Commit 9a82b80

Browse files
authored
Revert "Add basic reference/module resolution to program.go (#84)" (#91)
1 parent 9e97dbb commit 9a82b80

File tree

12 files changed

+412
-978
lines changed

12 files changed

+412
-978
lines changed

cmd/tsgo/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func main() {
5454

5555
rootPath := flag.Arg(0)
5656
compilerOptions := &core.CompilerOptions{Strict: core.TSTrue, Target: core.ScriptTargetESNext, ModuleKind: core.ModuleKindNodeNext}
57-
programOptions := ts.ProgramOptions{RootNames: []string{rootPath}, Options: compilerOptions, SingleThreaded: singleThreaded}
57+
programOptions := ts.ProgramOptions{RootPath: rootPath, Options: compilerOptions, SingleThreaded: singleThreaded}
5858
useCaseSensitiveFileNames := isFileSystemCaseSensitive()
5959

6060
startTime := time.Now()

internal/ast/ast.go

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5065,10 +5065,6 @@ type SourceFile struct {
50655065
ModuleAugmentations []*ModuleName // []ModuleName
50665066
PatternAmbientModules []PatternAmbientModule
50675067
AmbientModuleNames []string
5068-
Pragmas map[string][]Pragma
5069-
ReferencedFiles []FileReference
5070-
TypeReferenceDirectives []FileReference
5071-
LibReferenceDirectives []FileReference
50725068
HasNoDefaultLib bool
50735069
jsdocCache map[*Node][]*Node
50745070
}
@@ -5117,61 +5113,3 @@ func (node *SourceFile) ForEachChild(v Visitor) bool {
51175113
func IsSourceFile(node *Node) bool {
51185114
return node.Kind == KindSourceFile
51195115
}
5120-
5121-
type CommentRange struct {
5122-
core.TextRange
5123-
HasTrailingNewLine bool
5124-
Kind Kind
5125-
}
5126-
5127-
func NewCommentRange(kind Kind, pos int, end int, hasTrailingNewLine bool) CommentRange {
5128-
return CommentRange{
5129-
TextRange: core.NewTextRange(pos, end),
5130-
HasTrailingNewLine: hasTrailingNewLine,
5131-
Kind: kind,
5132-
}
5133-
}
5134-
5135-
type FileReference struct {
5136-
core.TextRange
5137-
FileName string
5138-
ResolutionMode core.ResolutionMode
5139-
Preserve bool
5140-
}
5141-
5142-
type PragmaArgument struct {
5143-
core.TextRange
5144-
Name string
5145-
Value string
5146-
}
5147-
5148-
type Pragma struct {
5149-
Name string
5150-
Args map[string]PragmaArgument
5151-
ArgsRange CommentRange
5152-
}
5153-
5154-
type PragmaKindFlags = uint8
5155-
5156-
const (
5157-
PragmaKindFlagsNone PragmaKindFlags = iota
5158-
PragmaKindTripleSlashXML
5159-
PragmaKindSingleLine
5160-
PragmaKindMultiLine
5161-
PragmaKindAll = PragmaKindTripleSlashXML | PragmaKindSingleLine | PragmaKindMultiLine
5162-
PragmaKindDefault = PragmaKindAll
5163-
)
5164-
5165-
type PragmaArgumentSpecification struct {
5166-
Name string
5167-
Optional bool
5168-
CaptureSpan bool
5169-
}
5170-
type PragmaSpecification struct {
5171-
Args []PragmaArgumentSpecification
5172-
Kind PragmaKindFlags
5173-
}
5174-
5175-
func (spec *PragmaSpecification) IsTripleSlash() bool {
5176-
return (spec.Kind & PragmaKindTripleSlashXML) > 0
5177-
}

internal/ast/kind.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ type Kind int16
77
const (
88
KindUnknown Kind = iota
99
KindEndOfFile
10-
KindSingleLineCommentTrivia
11-
KindMultiLineCommentTrivia
1210
KindConflictMarkerTrivia
1311
KindNonTextFileMarkerTrivia
1412
KindNumericLiteral
@@ -422,5 +420,4 @@ const (
422420
KindLastJSDocTagNode = KindJSDocImportTag
423421
KindFirstContextualKeyword = KindAbstractKeyword
424422
KindLastContextualKeyword = KindOfKeyword
425-
KindComment = KindSingleLineCommentTrivia | KindMultiLineCommentTrivia
426423
)

0 commit comments

Comments
 (0)