Documentation
¶
Index ¶
- Variables
- func CompilerOptionsAffectDeclarationPath(oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions) bool
- func CompilerOptionsAffectEmit(oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions) bool
- func CompilerOptionsAffectSemanticDiagnostics(oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions) bool
- func ConvertOptionToAbsolutePath(o string, v any, optionMap CommandLineOptionNameMap, cwd string) (any, bool)
- func CreateDiagnosticAtReferenceSyntax(config *ParsedCommandLine, index int, message *diagnostics.Message, ...) *ast.Diagnostic
- func CreateDiagnosticForNodeInSourceFile(sourceFile *ast.SourceFile, node *ast.Node, message *diagnostics.Message, ...) *ast.Diagnostic
- func CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile *ast.SourceFile, node *ast.Node, message *diagnostics.Message, ...) *ast.Diagnostic
- func ForEachCompilerOptionValue(options *core.CompilerOptions, declFilter func(*CommandLineOption) bool, ...) bool
- func ForEachPropertyAssignment[T any](objectLiteral *ast.ObjectLiteralExpression, key string, ...) *T
- func ForEachTsConfigPropArray[T any](tsConfigSourceFile *ast.SourceFile, propKey string, ...) *T
- func GetCallbackForFindingPropertyAssignmentByValue(value string) func(property *ast.PropertyAssignment) *ast.Node
- func GetDefaultLibFileName(options *core.CompilerOptions) string
- func GetLibFileName(libName string) (string, bool)
- func GetOptionsSyntaxByArrayElementValue(objectLiteral *ast.ObjectLiteralExpression, propKey string, ...) *ast.Node
- func GetSupportedExtensions(compilerOptions *core.CompilerOptions, extraFileExtensions []FileExtensionInfo) [][]string
- func GetSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions *core.CompilerOptions, supportedExtensions [][]string) [][]string
- func GetTsConfigPropArrayElementValue(tsConfigSourceFile *ast.SourceFile, propKey string, elementValue string) *ast.StringLiteral
- func ParseBuildOptions(key string, value any, allOptions *core.BuildOptions) []*ast.Diagnostic
- func ParseCompilerOptions(key string, value any, allOptions *core.CompilerOptions) []*ast.Diagnostic
- func ParseConfigFileTextToJson(fileName string, path tspath.Path, jsonText string) (any, []*ast.Diagnostic)
- func ParseListTypeOption(opt *CommandLineOption, value string) ([]any, []*ast.Diagnostic)
- func ParseString(value any) string
- func ParseStringArray(value any) []string
- func ParseTristate(value any) core.Tristate
- func ParseTypeAcquisition(key string, value any, allOptions *core.TypeAcquisition) []*ast.Diagnostic
- func ParseWatchOptions(key string, value any, allOptions *core.WatchOptions) []*ast.Diagnostic
- func TargetToLibMap() map[core.ScriptTarget]string
- type AlternateModeDiagnostics
- type CommandLineOption
- type CommandLineOptionKind
- type CommandLineOptionNameMap
- type CompilerOptionsValue
- type DidYouMeanOptionsDiagnostics
- type ExtendedConfigCache
- type ExtendedConfigCacheEntry
- type FileExtensionInfo
- type NameMap
- type ParseCommandLineWorkerDiagnostics
- type ParseConfigHost
- type ParsedBuildCommandLine
- type ParsedCommandLine
- func GetParsedCommandLineOfConfigFile(configFileName string, options *core.CompilerOptions, sys ParseConfigHost, ...) (*ParsedCommandLine, []*ast.Diagnostic)
- func GetParsedCommandLineOfConfigFilePath(configFileName string, path tspath.Path, options *core.CompilerOptions, ...) (*ParsedCommandLine, []*ast.Diagnostic)
- func NewParsedCommandLine(compilerOptions *core.CompilerOptions, rootFileNames []string, ...) *ParsedCommandLine
- func ParseCommandLine(commandLine []string, host ParseConfigHost) *ParsedCommandLine
- func ParseJsonConfigFileContent(json any, host ParseConfigHost, basePath string, ...) *ParsedCommandLine
- func ParseJsonSourceFileConfigFileContent(sourceFile *TsConfigSourceFile, host ParseConfigHost, basePath string, ...) *ParsedCommandLine
- func (p *ParsedCommandLine) CommonSourceDirectory() string
- func (p *ParsedCommandLine) CompilerOptions() *core.CompilerOptions
- func (p *ParsedCommandLine) ConfigName() string
- func (p *ParsedCommandLine) ExtendedSourceFiles() []string
- func (p *ParsedCommandLine) FileNames() []string
- func (p *ParsedCommandLine) FileNamesByPath() map[tspath.Path]string
- func (p *ParsedCommandLine) GetBuildInfoFileName() string
- func (p *ParsedCommandLine) GetConfigFileParsingDiagnostics() []*ast.Diagnostic
- func (p *ParsedCommandLine) GetCurrentDirectory() string
- func (p *ParsedCommandLine) GetMatchedFileSpec(fileName string) string
- func (p *ParsedCommandLine) GetMatchedIncludeSpec(fileName string) (string, bool)
- func (p *ParsedCommandLine) GetOutputDeclarationAndSourceFileNames() iter.Seq2[string, string]
- func (p *ParsedCommandLine) GetOutputFileNames() iter.Seq[string]
- func (p *ParsedCommandLine) LiteralFileNames() []string
- func (p *ParsedCommandLine) OutputDtsToProjectReference() map[tspath.Path]*SourceOutputAndProjectReference
- func (p *ParsedCommandLine) ParseInputOutputNames()
- func (p *ParsedCommandLine) PossiblyMatchesFileName(fileName string) bool
- func (p *ParsedCommandLine) ProjectReferences() []*core.ProjectReference
- func (p *ParsedCommandLine) ReloadFileNamesOfParsedCommandLine(fs vfs.FS) *ParsedCommandLine
- func (p *ParsedCommandLine) ResolvedProjectReferencePaths() []string
- func (p *ParsedCommandLine) SetCompilerOptions(o *core.CompilerOptions)
- func (p *ParsedCommandLine) SetParsedOptions(o *core.ParsedOptions)
- func (p *ParsedCommandLine) SetTypeAcquisition(o *core.TypeAcquisition)
- func (p *ParsedCommandLine) SourceToProjectReference() map[tspath.Path]*SourceOutputAndProjectReference
- func (p *ParsedCommandLine) TypeAcquisition() *core.TypeAcquisition
- func (p *ParsedCommandLine) UseCaseSensitiveFileNames() bool
- func (p *ParsedCommandLine) WildcardDirectories() map[string]bool
- func (p *ParsedCommandLine) WildcardDirectoryGlobs() []*glob.Glob
- type SourceOutputAndProjectReference
- type TsConfigSourceFile
Constants ¶
This section is empty.
Variables ¶
var ( Libs = slices.Collect(LibMap.Keys()) LibFilesSet = collections.NewSetFromItems(core.Map(slices.Collect(LibMap.Values()), func(s any) string { return s.(string) })...) )
var ( CompilerNameMap = GetNameMapFromList(OptionsDeclarations) BuildNameMap = GetNameMapFromList(BuildOpts) WatchNameMap = GetNameMapFromList(OptionsForWatch) )
var BuildOpts = slices.Concat(commonOptionsWithBuild, OptionsForBuild)
var CompilerOptionsDidYouMeanDiagnostics = getParseCommandLineWorkerDiagnostics(OptionsDeclarations)
var InverseJsxOptionMap = collections.NewOrderedMapFromList(func() []collections.MapEntry[core.JsxEmit, string] { entries := make([]collections.MapEntry[core.JsxEmit, string], 0, jsxOptionMap.Size()) for key, value := range jsxOptionMap.Entries() { entries = append(entries, collections.MapEntry[core.JsxEmit, string]{ Key: value.(core.JsxEmit), Value: key, }) } return entries }())
var LibMap = collections.NewOrderedMapFromList([]collections.MapEntry[string, any]{
{Key: "es5", Value: "lib.es5.d.ts"},
{Key: "es6", Value: "lib.es2015.d.ts"},
{Key: "es2015", Value: "lib.es2015.d.ts"},
{Key: "es7", Value: "lib.es2016.d.ts"},
{Key: "es2016", Value: "lib.es2016.d.ts"},
{Key: "es2017", Value: "lib.es2017.d.ts"},
{Key: "es2018", Value: "lib.es2018.d.ts"},
{Key: "es2019", Value: "lib.es2019.d.ts"},
{Key: "es2020", Value: "lib.es2020.d.ts"},
{Key: "es2021", Value: "lib.es2021.d.ts"},
{Key: "es2022", Value: "lib.es2022.d.ts"},
{Key: "es2023", Value: "lib.es2023.d.ts"},
{Key: "es2024", Value: "lib.es2024.d.ts"},
{Key: "esnext", Value: "lib.esnext.d.ts"},
{Key: "dom", Value: "lib.dom.d.ts"},
{Key: "dom.iterable", Value: "lib.dom.iterable.d.ts"},
{Key: "dom.asynciterable", Value: "lib.dom.asynciterable.d.ts"},
{Key: "webworker", Value: "lib.webworker.d.ts"},
{Key: "webworker.importscripts", Value: "lib.webworker.importscripts.d.ts"},
{Key: "webworker.iterable", Value: "lib.webworker.iterable.d.ts"},
{Key: "webworker.asynciterable", Value: "lib.webworker.asynciterable.d.ts"},
{Key: "scripthost", Value: "lib.scripthost.d.ts"},
{Key: "es2015.core", Value: "lib.es2015.core.d.ts"},
{Key: "es2015.collection", Value: "lib.es2015.collection.d.ts"},
{Key: "es2015.generator", Value: "lib.es2015.generator.d.ts"},
{Key: "es2015.iterable", Value: "lib.es2015.iterable.d.ts"},
{Key: "es2015.promise", Value: "lib.es2015.promise.d.ts"},
{Key: "es2015.proxy", Value: "lib.es2015.proxy.d.ts"},
{Key: "es2015.reflect", Value: "lib.es2015.reflect.d.ts"},
{Key: "es2015.symbol", Value: "lib.es2015.symbol.d.ts"},
{Key: "es2015.symbol.wellknown", Value: "lib.es2015.symbol.wellknown.d.ts"},
{Key: "es2016.array.include", Value: "lib.es2016.array.include.d.ts"},
{Key: "es2016.intl", Value: "lib.es2016.intl.d.ts"},
{Key: "es2017.arraybuffer", Value: "lib.es2017.arraybuffer.d.ts"},
{Key: "es2017.date", Value: "lib.es2017.date.d.ts"},
{Key: "es2017.object", Value: "lib.es2017.object.d.ts"},
{Key: "es2017.sharedmemory", Value: "lib.es2017.sharedmemory.d.ts"},
{Key: "es2017.string", Value: "lib.es2017.string.d.ts"},
{Key: "es2017.intl", Value: "lib.es2017.intl.d.ts"},
{Key: "es2017.typedarrays", Value: "lib.es2017.typedarrays.d.ts"},
{Key: "es2018.asyncgenerator", Value: "lib.es2018.asyncgenerator.d.ts"},
{Key: "es2018.asynciterable", Value: "lib.es2018.asynciterable.d.ts"},
{Key: "es2018.intl", Value: "lib.es2018.intl.d.ts"},
{Key: "es2018.promise", Value: "lib.es2018.promise.d.ts"},
{Key: "es2018.regexp", Value: "lib.es2018.regexp.d.ts"},
{Key: "es2019.array", Value: "lib.es2019.array.d.ts"},
{Key: "es2019.object", Value: "lib.es2019.object.d.ts"},
{Key: "es2019.string", Value: "lib.es2019.string.d.ts"},
{Key: "es2019.symbol", Value: "lib.es2019.symbol.d.ts"},
{Key: "es2019.intl", Value: "lib.es2019.intl.d.ts"},
{Key: "es2020.bigint", Value: "lib.es2020.bigint.d.ts"},
{Key: "es2020.date", Value: "lib.es2020.date.d.ts"},
{Key: "es2020.promise", Value: "lib.es2020.promise.d.ts"},
{Key: "es2020.sharedmemory", Value: "lib.es2020.sharedmemory.d.ts"},
{Key: "es2020.string", Value: "lib.es2020.string.d.ts"},
{Key: "es2020.symbol.wellknown", Value: "lib.es2020.symbol.wellknown.d.ts"},
{Key: "es2020.intl", Value: "lib.es2020.intl.d.ts"},
{Key: "es2020.number", Value: "lib.es2020.number.d.ts"},
{Key: "es2021.promise", Value: "lib.es2021.promise.d.ts"},
{Key: "es2021.string", Value: "lib.es2021.string.d.ts"},
{Key: "es2021.weakref", Value: "lib.es2021.weakref.d.ts"},
{Key: "es2021.intl", Value: "lib.es2021.intl.d.ts"},
{Key: "es2022.array", Value: "lib.es2022.array.d.ts"},
{Key: "es2022.error", Value: "lib.es2022.error.d.ts"},
{Key: "es2022.intl", Value: "lib.es2022.intl.d.ts"},
{Key: "es2022.object", Value: "lib.es2022.object.d.ts"},
{Key: "es2022.string", Value: "lib.es2022.string.d.ts"},
{Key: "es2022.regexp", Value: "lib.es2022.regexp.d.ts"},
{Key: "es2023.array", Value: "lib.es2023.array.d.ts"},
{Key: "es2023.collection", Value: "lib.es2023.collection.d.ts"},
{Key: "es2023.intl", Value: "lib.es2023.intl.d.ts"},
{Key: "es2024.arraybuffer", Value: "lib.es2024.arraybuffer.d.ts"},
{Key: "es2024.collection", Value: "lib.es2024.collection.d.ts"},
{Key: "es2024.object", Value: "lib.es2024.object.d.ts"},
{Key: "es2024.promise", Value: "lib.es2024.promise.d.ts"},
{Key: "es2024.regexp", Value: "lib.es2024.regexp.d.ts"},
{Key: "es2024.sharedmemory", Value: "lib.es2024.sharedmemory.d.ts"},
{Key: "es2024.string", Value: "lib.es2024.string.d.ts"},
{Key: "esnext.array", Value: "lib.es2023.array.d.ts"},
{Key: "esnext.collection", Value: "lib.esnext.collection.d.ts"},
{Key: "esnext.symbol", Value: "lib.es2019.symbol.d.ts"},
{Key: "esnext.asynciterable", Value: "lib.es2018.asynciterable.d.ts"},
{Key: "esnext.intl", Value: "lib.esnext.intl.d.ts"},
{Key: "esnext.disposable", Value: "lib.esnext.disposable.d.ts"},
{Key: "esnext.bigint", Value: "lib.es2020.bigint.d.ts"},
{Key: "esnext.string", Value: "lib.es2022.string.d.ts"},
{Key: "esnext.promise", Value: "lib.es2024.promise.d.ts"},
{Key: "esnext.weakref", Value: "lib.es2021.weakref.d.ts"},
{Key: "esnext.decorators", Value: "lib.esnext.decorators.d.ts"},
{Key: "esnext.object", Value: "lib.es2024.object.d.ts"},
{Key: "esnext.array", Value: "lib.esnext.array.d.ts"},
{Key: "esnext.regexp", Value: "lib.es2024.regexp.d.ts"},
{Key: "esnext.string", Value: "lib.es2024.string.d.ts"},
{Key: "esnext.iterator", Value: "lib.esnext.iterator.d.ts"},
{Key: "esnext.promise", Value: "lib.esnext.promise.d.ts"},
{Key: "esnext.float16", Value: "lib.esnext.float16.d.ts"},
{Key: "esnext.error", Value: "lib.esnext.error.d.ts"},
{Key: "esnext.sharedmemory", Value: "lib.esnext.sharedmemory.d.ts"},
{Key: "decorators", Value: "lib.decorators.d.ts"},
{Key: "decorators.legacy", Value: "lib.decorators.legacy.d.ts"},
})
var OptionsDeclarations = slices.Concat(commonOptionsWithBuild, optionsForCompiler)
var OptionsForBuild = []*CommandLineOption{ &TscBuildOption, { Name: "verbose", ShortName: "v", Category: diagnostics.Command_line_Options, Description: diagnostics.Enable_verbose_logging, Kind: "boolean", DefaultValueDescription: false, }, { Name: "dry", ShortName: "d", Category: diagnostics.Command_line_Options, Description: diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean, Kind: "boolean", DefaultValueDescription: false, }, { Name: "force", ShortName: "f", Category: diagnostics.Command_line_Options, Description: diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date, Kind: "boolean", DefaultValueDescription: false, }, { Name: "clean", Category: diagnostics.Command_line_Options, Description: diagnostics.Delete_the_outputs_of_all_projects, Kind: "boolean", DefaultValueDescription: false, }, { Name: "stopBuildOnErrors", Category: diagnostics.Command_line_Options, Description: diagnostics.Skip_building_downstream_projects_on_error_in_upstream_project, Kind: "boolean", DefaultValueDescription: false, }, }
var OptionsForWatch = []*CommandLineOption{ { Name: "watchInterval", Kind: CommandLineOptionTypeNumber, Category: diagnostics.Watch_and_Build_Modes, }, { Name: "watchFile", Kind: CommandLineOptionTypeEnum, Category: diagnostics.Watch_and_Build_Modes, Description: diagnostics.Specify_how_the_TypeScript_watch_mode_works, DefaultValueDescription: core.WatchFileKindUseFsEvents, }, { Name: "watchDirectory", Kind: CommandLineOptionTypeEnum, Category: diagnostics.Watch_and_Build_Modes, Description: diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality, DefaultValueDescription: core.WatchDirectoryKindUseFsEvents, }, { Name: "fallbackPolling", Kind: CommandLineOptionTypeEnum, Category: diagnostics.Watch_and_Build_Modes, Description: diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers, DefaultValueDescription: core.PollingKindPriorityInterval, }, { Name: "synchronousWatchDirectory", Kind: CommandLineOptionTypeBoolean, Category: diagnostics.Watch_and_Build_Modes, Description: diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively, DefaultValueDescription: false, }, { Name: "excludeDirectories", Kind: CommandLineOptionTypeList, Category: diagnostics.Watch_and_Build_Modes, Description: diagnostics.Remove_a_list_of_directories_from_the_watch_process, // contains filtered or unexported fields }, { Name: "excludeFiles", Kind: CommandLineOptionTypeList, Category: diagnostics.Watch_and_Build_Modes, Description: diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing, // contains filtered or unexported fields }, }
var TscBuildOption = CommandLineOption{ Name: "build", Kind: "boolean", ShortName: "b", ShowInSimplifiedHelpView: true, Category: diagnostics.Command_line_Options, Description: diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date, DefaultValueDescription: false, }
Functions ¶
func CompilerOptionsAffectDeclarationPath ¶
func CompilerOptionsAffectDeclarationPath( oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions, ) bool
func CompilerOptionsAffectEmit ¶
func CompilerOptionsAffectEmit(oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions) bool
func CompilerOptionsAffectSemanticDiagnostics ¶
func CompilerOptionsAffectSemanticDiagnostics( oldOptions *core.CompilerOptions, newOptions *core.CompilerOptions, ) bool
func CreateDiagnosticAtReferenceSyntax ¶
func CreateDiagnosticAtReferenceSyntax(config *ParsedCommandLine, index int, message *diagnostics.Message, args ...any) *ast.Diagnostic
func CreateDiagnosticForNodeInSourceFile ¶
func CreateDiagnosticForNodeInSourceFile(sourceFile *ast.SourceFile, node *ast.Node, message *diagnostics.Message, args ...any) *ast.Diagnostic
func CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic ¶
func CreateDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile *ast.SourceFile, node *ast.Node, message *diagnostics.Message, args ...any) *ast.Diagnostic
func ForEachCompilerOptionValue ¶
func ForEachCompilerOptionValue(options *core.CompilerOptions, declFilter func(*CommandLineOption) bool, fn func(option *CommandLineOption, value reflect.Value, i int) bool) bool
func ForEachPropertyAssignment ¶
func ForEachPropertyAssignment[T any](objectLiteral *ast.ObjectLiteralExpression, key string, callback func(property *ast.PropertyAssignment) *T, key2 ...string) *T
func ForEachTsConfigPropArray ¶
func ForEachTsConfigPropArray[T any](tsConfigSourceFile *ast.SourceFile, propKey string, callback func(property *ast.PropertyAssignment) *T) *T
func GetCallbackForFindingPropertyAssignmentByValue ¶
func GetCallbackForFindingPropertyAssignmentByValue(value string) func(property *ast.PropertyAssignment) *ast.Node
func GetDefaultLibFileName ¶
func GetDefaultLibFileName(options *core.CompilerOptions) string
func GetLibFileName ¶
func GetSupportedExtensions ¶
func GetSupportedExtensions(compilerOptions *core.CompilerOptions, extraFileExtensions []FileExtensionInfo) [][]string
func GetSupportedExtensionsWithJsonIfResolveJsonModule ¶
func GetSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions *core.CompilerOptions, supportedExtensions [][]string) [][]string
func GetTsConfigPropArrayElementValue ¶
func GetTsConfigPropArrayElementValue(tsConfigSourceFile *ast.SourceFile, propKey string, elementValue string) *ast.StringLiteral
func ParseBuildOptions ¶
func ParseBuildOptions(key string, value any, allOptions *core.BuildOptions) []*ast.Diagnostic
func ParseCompilerOptions ¶
func ParseCompilerOptions(key string, value any, allOptions *core.CompilerOptions) []*ast.Diagnostic
func ParseConfigFileTextToJson ¶
func ParseConfigFileTextToJson(fileName string, path tspath.Path, jsonText string) (any, []*ast.Diagnostic)
ParseConfigFileTextToJson parses the text of the tsconfig.json file fileName is the path to the config file jsonText is the text of the config file
func ParseListTypeOption ¶
func ParseListTypeOption(opt *CommandLineOption, value string) ([]any, []*ast.Diagnostic)
func ParseString ¶
func ParseStringArray ¶
func ParseTristate ¶
func ParseTypeAcquisition ¶
func ParseTypeAcquisition(key string, value any, allOptions *core.TypeAcquisition) []*ast.Diagnostic
func ParseWatchOptions ¶
func ParseWatchOptions(key string, value any, allOptions *core.WatchOptions) []*ast.Diagnostic
func TargetToLibMap ¶
func TargetToLibMap() map[core.ScriptTarget]string
Types ¶
type AlternateModeDiagnostics ¶
type AlternateModeDiagnostics struct {
// contains filtered or unexported fields
}
type CommandLineOption ¶
type CommandLineOption struct {
Name, ShortName string
Kind CommandLineOptionKind
// used in parsing
IsFilePath bool
IsTSConfigOnly bool
IsCommandLineOnly bool
// used in output
Description *diagnostics.Message
DefaultValueDescription any
ShowInSimplifiedHelpView bool
// used in output in serializing and generate tsconfig
Category *diagnostics.Message
// used for filter in compilerrunner
AffectsDeclarationPath bool
AffectsProgramStructure bool
AffectsSemanticDiagnostics bool
AffectsBuildInfo bool
AffectsBindDiagnostics bool
AffectsSourceFile bool
AffectsModuleResolution bool
AffectsEmit bool
// used for compilerOptionsDeclaration
ElementOptions CommandLineOptionNameMap
// contains filtered or unexported fields
}
func (*CommandLineOption) DeprecatedKeys ¶
func (o *CommandLineOption) DeprecatedKeys() *collections.Set[string]
func (*CommandLineOption) DisallowNullOrUndefined ¶
func (o *CommandLineOption) DisallowNullOrUndefined() bool
func (*CommandLineOption) Elements ¶
func (o *CommandLineOption) Elements() *CommandLineOption
func (*CommandLineOption) EnumMap ¶
func (o *CommandLineOption) EnumMap() *collections.OrderedMap[string, any]
type CommandLineOptionKind ¶
type CommandLineOptionKind string
const ( CommandLineOptionTypeString CommandLineOptionKind = "string" CommandLineOptionTypeNumber CommandLineOptionKind = "number" CommandLineOptionTypeBoolean CommandLineOptionKind = "boolean" CommandLineOptionTypeObject CommandLineOptionKind = "object" CommandLineOptionTypeList CommandLineOptionKind = "list" CommandLineOptionTypeListOrElement CommandLineOptionKind = "listOrElement" CommandLineOptionTypeEnum CommandLineOptionKind = "enum" // map )
type CommandLineOptionNameMap ¶
type CommandLineOptionNameMap map[string]*CommandLineOption
var CommandLineCompilerOptionsMap CommandLineOptionNameMap = commandLineOptionsToMap(OptionsDeclarations)
func (CommandLineOptionNameMap) Get ¶
func (m CommandLineOptionNameMap) Get(name string) *CommandLineOption
type CompilerOptionsValue ¶
type CompilerOptionsValue any
todo: revisit to see if this can be improved
type DidYouMeanOptionsDiagnostics ¶
type DidYouMeanOptionsDiagnostics struct {
OptionDeclarations []*CommandLineOption
UnknownOptionDiagnostic *diagnostics.Message
UnknownDidYouMeanDiagnostic *diagnostics.Message
// contains filtered or unexported fields
}
type ExtendedConfigCache ¶
type ExtendedConfigCache interface {
GetExtendedConfig(fileName string, path tspath.Path, parse func() *ExtendedConfigCacheEntry) *ExtendedConfigCacheEntry
}
type ExtendedConfigCacheEntry ¶
type ExtendedConfigCacheEntry struct {
// contains filtered or unexported fields
}
type FileExtensionInfo ¶
type FileExtensionInfo struct {
Extension string
IsMixedContent bool
ScriptKind core.ScriptKind
}
type NameMap ¶
type NameMap struct {
// contains filtered or unexported fields
}
func GetNameMapFromList ¶
func GetNameMapFromList(optDecls []*CommandLineOption) *NameMap
func (*NameMap) Get ¶
func (nm *NameMap) Get(name string) *CommandLineOption
func (*NameMap) GetFromShort ¶
func (nm *NameMap) GetFromShort(shortName string) *CommandLineOption
func (*NameMap) GetOptionDeclarationFromName ¶
func (nm *NameMap) GetOptionDeclarationFromName(optionName string, allowShort bool) *CommandLineOption
type ParseCommandLineWorkerDiagnostics ¶
type ParseCommandLineWorkerDiagnostics struct {
OptionTypeMismatchDiagnostic *diagnostics.Message
// contains filtered or unexported fields
}
type ParseConfigHost ¶
type ParsedBuildCommandLine ¶
type ParsedBuildCommandLine struct {
BuildOptions *core.BuildOptions `json:"buildOptions"`
CompilerOptions *core.CompilerOptions `json:"compilerOptions"`
WatchOptions *core.WatchOptions `json:"watchOptions"`
Projects []string `json:"projects"`
Errors []*ast.Diagnostic `json:"errors"`
// contains filtered or unexported fields
}
func ParseBuildCommandLine ¶
func ParseBuildCommandLine( commandLine []string, host ParseConfigHost, ) *ParsedBuildCommandLine
func (*ParsedBuildCommandLine) ResolvedProjectPaths ¶
func (p *ParsedBuildCommandLine) ResolvedProjectPaths() []string
type ParsedCommandLine ¶
type ParsedCommandLine struct {
ParsedConfig *core.ParsedOptions `json:"parsedConfig"`
ConfigFile *TsConfigSourceFile `json:"configFile"` // TsConfigSourceFile, used in Program and ExecuteCommandLine
Errors []*ast.Diagnostic `json:"errors"`
Raw any `json:"raw"`
CompileOnSave *bool `json:"compileOnSave"`
// contains filtered or unexported fields
}
func GetParsedCommandLineOfConfigFile ¶
func GetParsedCommandLineOfConfigFile( configFileName string, options *core.CompilerOptions, sys ParseConfigHost, extendedConfigCache ExtendedConfigCache, ) (*ParsedCommandLine, []*ast.Diagnostic)
Reads the config file and reports errors.
func GetParsedCommandLineOfConfigFilePath ¶
func GetParsedCommandLineOfConfigFilePath( configFileName string, path tspath.Path, options *core.CompilerOptions, sys ParseConfigHost, extendedConfigCache ExtendedConfigCache, ) (*ParsedCommandLine, []*ast.Diagnostic)
func NewParsedCommandLine ¶
func NewParsedCommandLine( compilerOptions *core.CompilerOptions, rootFileNames []string, comparePathsOptions tspath.ComparePathsOptions, ) *ParsedCommandLine
func ParseCommandLine ¶
func ParseCommandLine( commandLine []string, host ParseConfigHost, ) *ParsedCommandLine
func ParseJsonConfigFileContent ¶
func ParseJsonConfigFileContent(json any, host ParseConfigHost, basePath string, existingOptions *core.CompilerOptions, configFileName string, resolutionStack []tspath.Path, extraFileExtensions []FileExtensionInfo, extendedConfigCache ExtendedConfigCache) *ParsedCommandLine
ParseJsonConfigFileContent parses the contents of a config file (tsconfig.json). jsonNode: The contents of the config file to parse host: Instance of ParseConfigHost used to enumerate files in folder. basePath: A root directory to resolve relative path entries in the config file to. e.g. outDir
func ParseJsonSourceFileConfigFileContent ¶
func ParseJsonSourceFileConfigFileContent( sourceFile *TsConfigSourceFile, host ParseConfigHost, basePath string, existingOptions *core.CompilerOptions, configFileName string, resolutionStack []tspath.Path, extraFileExtensions []FileExtensionInfo, extendedConfigCache ExtendedConfigCache, ) *ParsedCommandLine
func (*ParsedCommandLine) CommonSourceDirectory ¶
func (p *ParsedCommandLine) CommonSourceDirectory() string
func (*ParsedCommandLine) CompilerOptions ¶
func (p *ParsedCommandLine) CompilerOptions() *core.CompilerOptions
func (*ParsedCommandLine) ConfigName ¶
func (p *ParsedCommandLine) ConfigName() string
func (*ParsedCommandLine) ExtendedSourceFiles ¶
func (p *ParsedCommandLine) ExtendedSourceFiles() []string
func (*ParsedCommandLine) FileNames ¶
func (p *ParsedCommandLine) FileNames() []string
All file names matched by files, include, and exclude patterns
func (*ParsedCommandLine) FileNamesByPath ¶
func (p *ParsedCommandLine) FileNamesByPath() map[tspath.Path]string
func (*ParsedCommandLine) GetBuildInfoFileName ¶
func (p *ParsedCommandLine) GetBuildInfoFileName() string
func (*ParsedCommandLine) GetConfigFileParsingDiagnostics ¶
func (p *ParsedCommandLine) GetConfigFileParsingDiagnostics() []*ast.Diagnostic
func (*ParsedCommandLine) GetCurrentDirectory ¶
func (p *ParsedCommandLine) GetCurrentDirectory() string
func (*ParsedCommandLine) GetMatchedFileSpec ¶
func (p *ParsedCommandLine) GetMatchedFileSpec(fileName string) string
func (*ParsedCommandLine) GetMatchedIncludeSpec ¶
func (p *ParsedCommandLine) GetMatchedIncludeSpec(fileName string) (string, bool)
func (*ParsedCommandLine) GetOutputDeclarationAndSourceFileNames ¶
func (p *ParsedCommandLine) GetOutputDeclarationAndSourceFileNames() iter.Seq2[string, string]
func (*ParsedCommandLine) GetOutputFileNames ¶
func (p *ParsedCommandLine) GetOutputFileNames() iter.Seq[string]
func (*ParsedCommandLine) LiteralFileNames ¶
func (p *ParsedCommandLine) LiteralFileNames() []string
Normalized file names explicitly specified in `files`
func (*ParsedCommandLine) OutputDtsToProjectReference ¶
func (p *ParsedCommandLine) OutputDtsToProjectReference() map[tspath.Path]*SourceOutputAndProjectReference
func (*ParsedCommandLine) ParseInputOutputNames ¶
func (p *ParsedCommandLine) ParseInputOutputNames()
func (*ParsedCommandLine) PossiblyMatchesFileName ¶
func (p *ParsedCommandLine) PossiblyMatchesFileName(fileName string) bool
PossiblyMatchesFileName is a fast check to see if a file is currently included by a config or would be included if the file were to be created. It may return false positives.
func (*ParsedCommandLine) ProjectReferences ¶
func (p *ParsedCommandLine) ProjectReferences() []*core.ProjectReference
func (*ParsedCommandLine) ReloadFileNamesOfParsedCommandLine ¶
func (p *ParsedCommandLine) ReloadFileNamesOfParsedCommandLine(fs vfs.FS) *ParsedCommandLine
func (*ParsedCommandLine) ResolvedProjectReferencePaths ¶
func (p *ParsedCommandLine) ResolvedProjectReferencePaths() []string
func (*ParsedCommandLine) SetCompilerOptions ¶
func (p *ParsedCommandLine) SetCompilerOptions(o *core.CompilerOptions)
func (*ParsedCommandLine) SetParsedOptions ¶
func (p *ParsedCommandLine) SetParsedOptions(o *core.ParsedOptions)
func (*ParsedCommandLine) SetTypeAcquisition ¶
func (p *ParsedCommandLine) SetTypeAcquisition(o *core.TypeAcquisition)
func (*ParsedCommandLine) SourceToProjectReference ¶
func (p *ParsedCommandLine) SourceToProjectReference() map[tspath.Path]*SourceOutputAndProjectReference
func (*ParsedCommandLine) TypeAcquisition ¶
func (p *ParsedCommandLine) TypeAcquisition() *core.TypeAcquisition
func (*ParsedCommandLine) UseCaseSensitiveFileNames ¶
func (p *ParsedCommandLine) UseCaseSensitiveFileNames() bool
func (*ParsedCommandLine) WildcardDirectories ¶
func (p *ParsedCommandLine) WildcardDirectories() map[string]bool
WildcardDirectories returns the cached wildcard directories, initializing them if needed
func (*ParsedCommandLine) WildcardDirectoryGlobs ¶
func (p *ParsedCommandLine) WildcardDirectoryGlobs() []*glob.Glob
type SourceOutputAndProjectReference ¶
type SourceOutputAndProjectReference struct {
Source string
OutputDts string
Resolved *ParsedCommandLine
}
type TsConfigSourceFile ¶
type TsConfigSourceFile struct {
ExtendedSourceFiles []string
SourceFile *ast.SourceFile
// contains filtered or unexported fields
}
func NewTsconfigSourceFileFromFilePath ¶
func NewTsconfigSourceFileFromFilePath(configFileName string, configPath tspath.Path, configSourceText string) *TsConfigSourceFile