Documentation
¶
Index ¶
- Variables
- func GetDefaultLibFileName(options *core.CompilerOptions) string
- func GetLibFileName(libName string) (string, bool)
- func GetSupportedExtensions(compilerOptions *core.CompilerOptions, extraFileExtensions []fileExtensionInfo) [][]string
- func GetSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions *core.CompilerOptions, supportedExtensions [][]string) [][]string
- 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) ([]string, []*ast.Diagnostic)
- func ParseTypeAcquisition(key string, value any, allOptions *core.TypeAcquisition) []*ast.Diagnostic
- func ParseWatchOptions(key string, value any, allOptions *core.WatchOptions) []*ast.Diagnostic
- func TryReadFile(fileName string, readFile func(string) (string, bool), ...) (string, []*ast.Diagnostic)
- type AlternateModeDiagnostics
- type CommandLineOption
- type CommandLineOptionKind
- type CompilerOptionsValue
- type DidYouMeanOptionsDiagnostics
- type ExtendedConfigCacheEntry
- type FileMatcherPatterns
- type NameMap
- type ParseCommandLineWorkerDiagnostics
- type ParseConfigHost
- type 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 ReloadFileNamesOfParsedCommandLine(p *ParsedCommandLine, fs vfs.FS) *ParsedCommandLine
- func (p *ParsedCommandLine) CompilerOptions() *core.CompilerOptions
- func (p *ParsedCommandLine) FileNames() []string
- func (p *ParsedCommandLine) GetConfigFileParsingDiagnostics() []*ast.Diagnostic
- func (p *ParsedCommandLine) LiteralFileNames() []string
- func (p *ParsedCommandLine) MatchesFileName(fileName string) bool
- func (p *ParsedCommandLine) ProjectReferences() []core.ProjectReference
- func (p *ParsedCommandLine) SetCompilerOptions(o *core.CompilerOptions)
- func (p *ParsedCommandLine) SetParsedOptions(o *core.ParsedOptions)
- func (p *ParsedCommandLine) WildcardDirectories() map[string]bool
- type TsConfigSourceFile
- type WildcardMatcher
Constants ¶
This section is empty.
Variables ¶
var ( Libs = slices.Collect(libMap.Keys()) LibFilesSet = core.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 OptionsDeclarations = slices.Concat(commonOptionsWithBuild, optionsForCompiler)
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 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 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) ([]string, []*ast.Diagnostic)
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 TryReadFile ¶
func TryReadFile(fileName string, readFile func(string) (string, bool), errors []*ast.Diagnostic) (string, []*ast.Diagnostic)
Types ¶
type AlternateModeDiagnostics ¶
type AlternateModeDiagnostics struct {
// contains filtered or unexported fields
}
type CommandLineOption ¶
type CommandLineOption struct {
Name, ShortName string
Kind CommandLineOptionKind
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 map[string]*CommandLineOption
// contains filtered or unexported fields
}
func (*CommandLineOption) DeprecatedKeys ¶
func (o *CommandLineOption) DeprecatedKeys() *core.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 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 ExtendedConfigCacheEntry ¶
type ExtendedConfigCacheEntry struct {
// contains filtered or unexported fields
}
type FileMatcherPatterns ¶
type FileMatcherPatterns struct {
// contains filtered or unexported fields
}
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 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 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 map[tspath.Path]*ExtendedConfigCacheEntry) *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 map[tspath.Path]*ExtendedConfigCacheEntry) *ParsedCommandLine
func ReloadFileNamesOfParsedCommandLine ¶
func ReloadFileNamesOfParsedCommandLine(p *ParsedCommandLine, fs vfs.FS) *ParsedCommandLine
func (*ParsedCommandLine) CompilerOptions ¶
func (p *ParsedCommandLine) CompilerOptions() *core.CompilerOptions
func (*ParsedCommandLine) FileNames ¶
func (p *ParsedCommandLine) FileNames() []string
All file names matched by files, include, and exclude patterns
func (*ParsedCommandLine) GetConfigFileParsingDiagnostics ¶
func (p *ParsedCommandLine) GetConfigFileParsingDiagnostics() []*ast.Diagnostic
func (*ParsedCommandLine) LiteralFileNames ¶
func (p *ParsedCommandLine) LiteralFileNames() []string
Normalized file names explicitly specified in `files`
func (*ParsedCommandLine) MatchesFileName ¶
func (p *ParsedCommandLine) MatchesFileName(fileName string) bool
Porting reference: ProjectService.isMatchedByConfig
func (*ParsedCommandLine) ProjectReferences ¶
func (p *ParsedCommandLine) ProjectReferences() []core.ProjectReference
func (*ParsedCommandLine) SetCompilerOptions ¶
func (p *ParsedCommandLine) SetCompilerOptions(o *core.CompilerOptions)
func (*ParsedCommandLine) SetParsedOptions ¶
func (p *ParsedCommandLine) SetParsedOptions(o *core.ParsedOptions)
func (*ParsedCommandLine) WildcardDirectories ¶
func (p *ParsedCommandLine) WildcardDirectories() map[string]bool
WildcardDirectories returns the cached wildcard directories, initializing them if needed
type TsConfigSourceFile ¶
type TsConfigSourceFile struct { SourceFile *ast.SourceFile // contains filtered or unexported fields }
func NewTsconfigSourceFileFromFilePath ¶
func NewTsconfigSourceFileFromFilePath(configFileName string, configPath tspath.Path, configSourceText string) *TsConfigSourceFile
type WildcardMatcher ¶
type WildcardMatcher struct {
// contains filtered or unexported fields
}