Documentation
¶
Index ¶
- Variables
- func AssertHasRealPosition(node *ast.Node)
- func CompareImportsOrRequireStatements(s1 *ast.Statement, s2 *ast.Statement, comparer func(a, b string) int) int
- func CompareModuleSpecifiers(m1 *ast.Expression, m2 *ast.Expression, comparer func(a, b string) int) int
- func DetectModuleSpecifierCaseBySort(importDeclsByGroup [][]*ast.Statement, comparersToTest []func(a, b string) int) (comparer func(a, b string) int, isSorted bool)
- func FilterImportDeclarations(statements []*ast.Statement) []*ast.Statement
- func GetExternalModuleName(specifier *ast.Expression) string
- func GetFirstToken(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func GetImportDeclarationInsertIndex(sortedImports []*ast.Statement, newImport *ast.Statement, ...) int
- func GetImportSpecifierInsertionIndex(sortedImports []*ast.Node, newImport *ast.Node, ...) int
- func GetLastChild(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func GetLastToken(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func GetLastVisitedChild(node *ast.Node, sourceFile *ast.SourceFile) *ast.Node
- func GetNamedImportSpecifierComparer(preferences *UserPreferences, comparer func(a, b string) int) func(s1, s2 *ast.Node) int
- func GetNamedImportSpecifierComparerWithDetection(importDecl *ast.Node, sourceFile *ast.SourceFile, preferences *UserPreferences) (specifierComparer func(s1, s2 *ast.Node) int, isSorted core.Tristate)
- func GetOrganizeImportsStringComparerWithDetection(originalImportDecls []*ast.Statement, preferences *UserPreferences) (comparer func(a, b string) int, isSorted bool)
- func GetSymbolModifiers(typeChecker *checker.Checker, symbol *ast.Symbol) collections.Set[ScriptElementKindModifier]
- func IsNonContextualKeyword(token ast.Kind) bool
- func ModuleSpecifierToValidIdentifier(moduleSpecifier string, forceCapitalize bool) string
- func ModuleSymbolToValidIdentifier(moduleSymbol *ast.Symbol, forceCapitalize bool) string
- func NodeIsASICandidate(node *ast.Node, file *ast.SourceFile) bool
- func PositionIsASICandidate(pos int, context *ast.Node, file *ast.SourceFile) bool
- func ProbablyUsesSemicolons(file *ast.SourceFile) bool
- func ShouldUseUriStyleNodeCoreModules(file *ast.SourceFile, program *compiler.Program) core.Tristate
- func SyntaxMayBeASICandidate(kind ast.Kind) bool
- func SyntaxRequiresTrailingCommaOrSemicolonOrASI(kind ast.Kind) bool
- func SyntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind ast.Kind) bool
- func SyntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind ast.Kind) bool
- func SyntaxRequiresTrailingSemicolonOrASI(kind ast.Kind) bool
- type CodeLensUserPreferences
- type EditorSettings
- type FormatCodeSettings
- func (settings *FormatCodeSettings) Copy() *FormatCodeSettings
- func (settings *FormatCodeSettings) Parse(prefs any) bool
- func (settings *FormatCodeSettings) ParseEditorSettings(editorSettings map[string]any) *FormatCodeSettings
- func (settings *FormatCodeSettings) Set(name string, value any) bool
- func (settings *FormatCodeSettings) ToLSFormatOptions() *lsproto.FormattingOptions
- type IncludeInlayParameterNameHints
- type IncludePackageJsonAutoImports
- type IndentStyle
- type InlayHintsPreferences
- type JsxAttributeCompletionStyle
- type OrganizeImportsCaseFirst
- type OrganizeImportsCollation
- type OrganizeImportsTypeOrder
- func DetectNamedImportOrganizationBySort(originalGroups []*ast.Statement, comparersToTest []func(a, b string) int, ...) (comparer func(a, b string) int, typeOrder OrganizeImportsTypeOrder, found bool)
- func GetDetectionLists(preferences *UserPreferences) (comparersToTest []func(a, b string) int, ...)
- type QuotePreference
- type ScriptElementKind
- type ScriptElementKindModifier
- type SemicolonPreference
- type UserConfig
- type UserPreferences
- func (p *UserPreferences) Copy() *UserPreferences
- func (p *UserPreferences) CopyOrDefault() *UserPreferences
- func (p *UserPreferences) IsModuleSpecifierExcluded(moduleSpecifier string) bool
- func (p *UserPreferences) ModuleSpecifierPreferences() modulespecifiers.UserPreferences
- func (p *UserPreferences) OrDefault() *UserPreferences
- func (p *UserPreferences) ParseWorker(config map[string]any) *UserPreferences
- func (p *UserPreferences) ParsedAutoImportFileExcludePatterns(useCaseSensitiveFileNames bool) []*regexp2.Regexp
- func (p *UserPreferences) Set(name string, value any) bool
Constants ¶
This section is empty.
Variables ¶
var FileExtensionKindModifiers = []ScriptElementKindModifier{ ScriptElementKindModifierDts, ScriptElementKindModifierTs, ScriptElementKindModifierTsx, ScriptElementKindModifierJs, ScriptElementKindModifierJsx, ScriptElementKindModifierJson, ScriptElementKindModifierDmts, ScriptElementKindModifierMts, ScriptElementKindModifierMjs, ScriptElementKindModifierDcts, ScriptElementKindModifierCts, ScriptElementKindModifierCjs, }
Functions ¶
func AssertHasRealPosition ¶
func CompareImportsOrRequireStatements ¶
func CompareImportsOrRequireStatements(s1 *ast.Statement, s2 *ast.Statement, comparer func(a, b string) int) int
CompareImportsOrRequireStatements compares two import or require statements.
func CompareModuleSpecifiers ¶
func CompareModuleSpecifiers(m1 *ast.Expression, m2 *ast.Expression, comparer func(a, b string) int) int
CompareModuleSpecifiers compares two module specifiers using the given comparer.
func DetectModuleSpecifierCaseBySort ¶
func DetectModuleSpecifierCaseBySort(importDeclsByGroup [][]*ast.Statement, comparersToTest []func(a, b string) int) (comparer func(a, b string) int, isSorted bool)
DetectModuleSpecifierCaseBySort detects the order of module specifiers based on import statements throughout the module/file
func FilterImportDeclarations ¶
FilterImportDeclarations filters out non-import declarations from a list of statements.
func GetExternalModuleName ¶
func GetExternalModuleName(specifier *ast.Expression) string
GetExternalModuleName returns the module name from a module specifier expression.
func GetFirstToken ¶
func GetImportDeclarationInsertIndex ¶
func GetImportDeclarationInsertIndex(sortedImports []*ast.Statement, newImport *ast.Statement, comparer func(a, b *ast.Statement) int) int
GetImportDeclarationInsertIndex returns the index at which to insert a new import declaration.
func GetImportSpecifierInsertionIndex ¶
func GetImportSpecifierInsertionIndex(sortedImports []*ast.Node, newImport *ast.Node, comparer func(s1, s2 *ast.Node) int) int
GetImportSpecifierInsertionIndex returns the index at which to insert a new import specifier.
func GetLastChild ¶
Replaces last(node.getChildren(sourceFile))
func GetLastToken ¶
func GetLastVisitedChild ¶
Gets the last visited child of the given node. NOTE: This doesn't include unvisited tokens; for this, use `getLastChild` or `getLastToken`.
func GetNamedImportSpecifierComparer ¶
func GetNamedImportSpecifierComparer(preferences *UserPreferences, comparer func(a, b string) int) func(s1, s2 *ast.Node) int
GetNamedImportSpecifierComparer returns a comparer function for sorting import specifiers.
func GetNamedImportSpecifierComparerWithDetection ¶
func GetNamedImportSpecifierComparerWithDetection(importDecl *ast.Node, sourceFile *ast.SourceFile, preferences *UserPreferences) (specifierComparer func(s1, s2 *ast.Node) int, isSorted core.Tristate)
GetNamedImportSpecifierComparerWithDetection returns a specifier comparer based on detecting the existing sort order within a single import statement
func GetOrganizeImportsStringComparerWithDetection ¶
func GetOrganizeImportsStringComparerWithDetection(originalImportDecls []*ast.Statement, preferences *UserPreferences) (comparer func(a, b string) int, isSorted bool)
GetOrganizeImportsStringComparerWithDetection returns a string comparer based on detecting the order of import statements by the module specifier
func GetSymbolModifiers ¶
func GetSymbolModifiers(typeChecker *checker.Checker, symbol *ast.Symbol) collections.Set[ScriptElementKindModifier]
func IsNonContextualKeyword ¶
func NodeIsASICandidate ¶
func NodeIsASICandidate(node *ast.Node, file *ast.SourceFile) bool
func PositionIsASICandidate ¶
func ProbablyUsesSemicolons ¶
func ProbablyUsesSemicolons(file *ast.SourceFile) bool
func SyntaxMayBeASICandidate ¶
Types ¶
type CodeLensUserPreferences ¶
type EditorSettings ¶
type FormatCodeSettings ¶
type FormatCodeSettings struct {
EditorSettings
InsertSpaceAfterCommaDelimiter core.Tristate
InsertSpaceAfterSemicolonInForStatements core.Tristate
InsertSpaceBeforeAndAfterBinaryOperators core.Tristate
InsertSpaceAfterConstructor core.Tristate
InsertSpaceAfterKeywordsInControlFlowStatements core.Tristate
InsertSpaceAfterFunctionKeywordForAnonymousFunctions core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingEmptyBraces core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces core.Tristate
InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces core.Tristate
InsertSpaceAfterTypeAssertion core.Tristate
InsertSpaceBeforeFunctionParenthesis core.Tristate
PlaceOpenBraceOnNewLineForFunctions core.Tristate
PlaceOpenBraceOnNewLineForControlBlocks core.Tristate
InsertSpaceBeforeTypeAnnotation core.Tristate
IndentMultiLineObjectLiteralBeginningOnBlankLine core.Tristate
Semicolons SemicolonPreference
IndentSwitchCase core.Tristate
}
func FromLSFormatOptions ¶
func FromLSFormatOptions(f *FormatCodeSettings, opt *lsproto.FormattingOptions) *FormatCodeSettings
func GetDefaultFormatCodeSettings ¶
func GetDefaultFormatCodeSettings() *FormatCodeSettings
func (*FormatCodeSettings) Copy ¶
func (settings *FormatCodeSettings) Copy() *FormatCodeSettings
func (*FormatCodeSettings) Parse ¶
func (settings *FormatCodeSettings) Parse(prefs any) bool
func (*FormatCodeSettings) ParseEditorSettings ¶
func (settings *FormatCodeSettings) ParseEditorSettings(editorSettings map[string]any) *FormatCodeSettings
func (*FormatCodeSettings) Set ¶
func (settings *FormatCodeSettings) Set(name string, value any) bool
func (*FormatCodeSettings) ToLSFormatOptions ¶
func (settings *FormatCodeSettings) ToLSFormatOptions() *lsproto.FormattingOptions
type IncludeInlayParameterNameHints ¶
type IncludeInlayParameterNameHints string
const ( IncludeInlayParameterNameHintsNone IncludeInlayParameterNameHints = "" IncludeInlayParameterNameHintsAll IncludeInlayParameterNameHints = "all" IncludeInlayParameterNameHintsLiterals IncludeInlayParameterNameHints = "literals" )
type IncludePackageJsonAutoImports ¶
type IncludePackageJsonAutoImports string
const ( IncludePackageJsonAutoImportsUnknown IncludePackageJsonAutoImports = "" // !!! IncludePackageJsonAutoImportsAuto IncludePackageJsonAutoImports = "auto" IncludePackageJsonAutoImportsOn IncludePackageJsonAutoImports = "on" IncludePackageJsonAutoImportsOff IncludePackageJsonAutoImports = "off" )
type IndentStyle ¶
type IndentStyle int
const ( IndentStyleNone IndentStyle = iota IndentStyleBlock IndentStyleSmart )
type InlayHintsPreferences ¶
type InlayHintsPreferences struct {
IncludeInlayParameterNameHints IncludeInlayParameterNameHints
IncludeInlayParameterNameHintsWhenArgumentMatchesName bool
IncludeInlayFunctionParameterTypeHints bool
IncludeInlayVariableTypeHints bool
IncludeInlayVariableTypeHintsWhenTypeMatchesName bool
IncludeInlayPropertyDeclarationTypeHints bool
IncludeInlayFunctionLikeReturnTypeHints bool
IncludeInlayEnumMemberValueHints bool
}
type JsxAttributeCompletionStyle ¶
type JsxAttributeCompletionStyle string
const ( JsxAttributeCompletionStyleUnknown JsxAttributeCompletionStyle = "" // !!! JsxAttributeCompletionStyleAuto JsxAttributeCompletionStyle = "auto" JsxAttributeCompletionStyleBraces JsxAttributeCompletionStyle = "braces" JsxAttributeCompletionStyleNone JsxAttributeCompletionStyle = "none" )
type OrganizeImportsCaseFirst ¶
type OrganizeImportsCaseFirst int
const ( OrganizeImportsCaseFirstFalse OrganizeImportsCaseFirst = 0 OrganizeImportsCaseFirstLower OrganizeImportsCaseFirst = 1 OrganizeImportsCaseFirstUpper OrganizeImportsCaseFirst = 2 )
type OrganizeImportsCollation ¶
type OrganizeImportsCollation bool
const ( OrganizeImportsCollationOrdinal OrganizeImportsCollation = false OrganizeImportsCollationUnicode OrganizeImportsCollation = true )
type OrganizeImportsTypeOrder ¶
type OrganizeImportsTypeOrder int
const ( OrganizeImportsTypeOrderAuto OrganizeImportsTypeOrder = 0 OrganizeImportsTypeOrderLast OrganizeImportsTypeOrder = 1 OrganizeImportsTypeOrderInline OrganizeImportsTypeOrder = 2 OrganizeImportsTypeOrderFirst OrganizeImportsTypeOrder = 3 )
func DetectNamedImportOrganizationBySort ¶
func DetectNamedImportOrganizationBySort( originalGroups []*ast.Statement, comparersToTest []func(a, b string) int, typesToTest []OrganizeImportsTypeOrder, ) (comparer func(a, b string) int, typeOrder OrganizeImportsTypeOrder, found bool)
DetectNamedImportOrganizationBySort detects the order of named imports throughout the file by considering the named imports in each statement as a group
func GetDetectionLists ¶
func GetDetectionLists(preferences *UserPreferences) (comparersToTest []func(a, b string) int, typeOrdersToTest []OrganizeImportsTypeOrder)
GetDetectionLists returns the lists of comparers and type orders to test for organize imports detection.
type QuotePreference ¶
type QuotePreference string
const ( QuotePreferenceUnknown QuotePreference = "" QuotePreferenceAuto QuotePreference = "auto" QuotePreferenceDouble QuotePreference = "double" QuotePreferenceSingle QuotePreference = "single" )
func GetQuotePreference ¶
func GetQuotePreference(sourceFile *ast.SourceFile, preferences *UserPreferences) QuotePreference
func QuotePreferenceFromString ¶
func QuotePreferenceFromString(str *ast.StringLiteral) QuotePreference
type ScriptElementKind ¶
type ScriptElementKind int
const ( ScriptElementKindUnknown ScriptElementKind = iota ScriptElementKindWarning // predefined type (void) or keyword (class) ScriptElementKindKeyword // top level script node ScriptElementKindScriptElement // module foo {} ScriptElementKindModuleElement // class X {} ScriptElementKindClassElement // var x = class X {} ScriptElementKindLocalClassElement // interface Y {} ScriptElementKindInterfaceElement // type T = ... ScriptElementKindTypeElement // enum E {} ScriptElementKindEnumElement ScriptElementKindEnumMemberElement // Inside module and script only. // const v = ... ScriptElementKindVariableElement // Inside function. ScriptElementKindLocalVariableElement // using foo = ... ScriptElementKindVariableUsingElement // await using foo = ... ScriptElementKindVariableAwaitUsingElement // Inside module and script only. // function f() {} ScriptElementKindFunctionElement // Inside function. ScriptElementKindLocalFunctionElement // class X { [public|private]* foo() {} } ScriptElementKindMemberFunctionElement // class X { [public|private]* [get|set] foo:number; } ScriptElementKindMemberGetAccessorElement ScriptElementKindMemberSetAccessorElement // class X { [public|private]* foo:number; } // interface Y { foo:number; } ScriptElementKindMemberVariableElement // class X { [public|private]* accessor foo: number; } ScriptElementKindMemberAccessorVariableElement // class X { constructor() { } } // class X { static { } } ScriptElementKindConstructorImplementationElement // interface Y { ():number; } ScriptElementKindCallSignatureElement // interface Y { []:number; } ScriptElementKindIndexSignatureElement // interface Y { new():Y; } ScriptElementKindConstructSignatureElement // function foo(*Y*: string) ScriptElementKindParameterElement ScriptElementKindTypeParameterElement ScriptElementKindPrimitiveType ScriptElementKindLabel ScriptElementKindAlias ScriptElementKindConstElement ScriptElementKindLetElement ScriptElementKindDirectory ScriptElementKindExternalModuleName // String literal ScriptElementKindString // Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" ScriptElementKindLink // Jsdoc @link: in `{@link C link text}`, the entity name "C" ScriptElementKindLinkName // Jsdoc @link: in `{@link C link text}`, the link text "link text" ScriptElementKindLinkText )
func GetSymbolKind ¶
type ScriptElementKindModifier ¶
type ScriptElementKindModifier string
const ( ScriptElementKindModifierNone ScriptElementKindModifier = "" ScriptElementKindModifierPublic ScriptElementKindModifier = "public" ScriptElementKindModifierPrivate ScriptElementKindModifier = "private" ScriptElementKindModifierProtected ScriptElementKindModifier = "protected" ScriptElementKindModifierExported ScriptElementKindModifier = "export" ScriptElementKindModifierAmbient ScriptElementKindModifier = "declare" ScriptElementKindModifierStatic ScriptElementKindModifier = "static" ScriptElementKindModifierAbstract ScriptElementKindModifier = "abstract" ScriptElementKindModifierOptional ScriptElementKindModifier = "optional" ScriptElementKindModifierDeprecated ScriptElementKindModifier = "deprecated" ScriptElementKindModifierDts ScriptElementKindModifier = ".d.ts" ScriptElementKindModifierTs ScriptElementKindModifier = ".ts" ScriptElementKindModifierTsx ScriptElementKindModifier = ".tsx" ScriptElementKindModifierJs ScriptElementKindModifier = ".js" ScriptElementKindModifierJsx ScriptElementKindModifier = ".jsx" ScriptElementKindModifierJson ScriptElementKindModifier = ".json" ScriptElementKindModifierDmts ScriptElementKindModifier = ".d.mts" ScriptElementKindModifierMts ScriptElementKindModifier = ".mts" ScriptElementKindModifierMjs ScriptElementKindModifier = ".mjs" ScriptElementKindModifierDcts ScriptElementKindModifier = ".d.cts" ScriptElementKindModifierCts ScriptElementKindModifier = ".cts" ScriptElementKindModifierCjs ScriptElementKindModifier = ".cjs" )
type SemicolonPreference ¶
type SemicolonPreference string
const ( SemicolonPreferenceIgnore SemicolonPreference = "ignore" SemicolonPreferenceInsert SemicolonPreference = "insert" SemicolonPreferenceRemove SemicolonPreference = "remove" )
type UserConfig ¶
type UserConfig struct {
// contains filtered or unexported fields
}
func NewUserConfig ¶
func NewUserConfig(userPreferences *UserPreferences) *UserConfig
if `userPreferences` is nil, this function will return a config with default userPreferences
func ParseNewUserConfig ¶
func ParseNewUserConfig(items map[string]any) *UserConfig
func (*UserConfig) Copy ¶
func (c *UserConfig) Copy() *UserConfig
func (*UserConfig) GetPreferences ¶
func (c *UserConfig) GetPreferences(activeFile string) *UserPreferences
func (*UserConfig) JS ¶
func (c *UserConfig) JS() *UserPreferences
func (*UserConfig) Merge ¶
func (a *UserConfig) Merge(b *UserConfig) *UserConfig
any non-nil field in b is copied into a
func (*UserConfig) TS ¶
func (c *UserConfig) TS() *UserPreferences
type UserPreferences ¶
type UserPreferences struct {
FormatCodeSettings *FormatCodeSettings
QuotePreference QuotePreference
LazyConfiguredProjectsFromExternalProject bool // !!!
// A positive integer indicating the maximum length of a hover text before it is truncated.
//
// Default: `500`
MaximumHoverLength int // !!!
// If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
// This affects lone identifier completions but not completions on the right hand side of `obj.`.
IncludeCompletionsForModuleExports core.Tristate
// Enables auto-import-style completions on partially-typed import statements. E.g., allows
// `import write|` to be completed to `import { writeFile } from "fs"`.
IncludeCompletionsForImportStatements core.Tristate
// Unless this option is `false`, member completion lists triggered with `.` will include entries
// on potentially-null and potentially-undefined values, with insertion text to replace
// preceding `.` tokens with `?.`.
IncludeAutomaticOptionalChainCompletions core.Tristate
// If enabled, completions for class members (e.g. methods and properties) will include
// a whole declaration for the member.
// E.g., `class A { f| }` could be completed to `class A { foo(): number {} }`, instead of
// `class A { foo }`.
IncludeCompletionsWithClassMemberSnippets core.Tristate // !!!
// If enabled, object literal methods will have a method declaration completion entry in addition
// to the regular completion entry containing just the method name.
// E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
// in addition to `const objectLiteral: T = { foo }`.
IncludeCompletionsWithObjectLiteralMethodSnippets core.Tristate // !!!
JsxAttributeCompletionStyle JsxAttributeCompletionStyle
ImportModuleSpecifierPreference modulespecifiers.ImportModuleSpecifierPreference
// Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js"
ImportModuleSpecifierEnding modulespecifiers.ImportModuleSpecifierEndingPreference
IncludePackageJsonAutoImports IncludePackageJsonAutoImports
AutoImportSpecifierExcludeRegexes []string
AutoImportFileExcludePatterns []string
PreferTypeOnlyAutoImports core.Tristate
// Indicates whether imports should be organized in a case-insensitive manner.
//
// Default: TSUnknown ("auto" in strada), will perform detection
OrganizeImportsIgnoreCase core.Tristate // !!!
// Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value of their
// code points, or via "unicode" collation (via the Unicode Collation Algorithm (https://unicode.org/reports/tr10/#Scope))
//
// using rules associated with the locale specified in organizeImportsCollationLocale.
//
// Default: Ordinal
OrganizeImportsCollation OrganizeImportsCollation // !!!
// Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant
// for the sake of consistent sorting. Use `"auto"` to use the detected UI locale.
//
// This preference is ignored if organizeImportsCollation is not `unicode`.
//
// Default: `"en"`
OrganizeImportsLocale string // !!!
// Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate
// strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`.
//
// This preference is ignored if organizeImportsCollation is not `unicode`.
//
// Default: `false`
OrganizeImportsNumericCollation bool // !!!
// Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When
// `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified
// in organizeImportsCollationLocale.
//
// This preference is ignored if organizeImportsCollation is not `unicode`.
//
// Default: `true`
OrganizeImportsAccentCollation bool // !!!
// Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale
// specified in organizeImportsCollationLocale is used.
//
// This preference is ignored if:
// - organizeImportsCollation is not `unicode`
// - organizeImportsIgnoreCase is `true`
// - organizeImportsIgnoreCase is `auto` and the auto-detected case sensitivity is case-insensitive.
//
// Default: `false`
OrganizeImportsCaseFirst OrganizeImportsCaseFirst // !!!
// Indicates where named type-only imports should sort. "inline" sorts named imports without regard to if the import is type-only.
//
// Default: `auto`, which defaults to `last`
OrganizeImportsTypeOrder OrganizeImportsTypeOrder // !!!
AllowTextChangesInNewFiles bool // !!!
// renamed from `providePrefixAndSuffixTextForRename`
UseAliasesForRename core.Tristate
AllowRenameOfImportPath core.Tristate
ProvideRefactorNotApplicableReason bool // !!!
InlayHints InlayHintsPreferences
CodeLens CodeLensUserPreferences
DisableSuggestions bool // !!!
DisableLineTextInReferences bool // !!!
DisplayPartsForJSDoc bool // !!!
ReportStyleChecksAsWarnings bool // !!! If this changes, we need to ask the client to recompute diagnostics
}
func NewDefaultUserPreferences ¶
func NewDefaultUserPreferences() *UserPreferences
func (*UserPreferences) Copy ¶
func (p *UserPreferences) Copy() *UserPreferences
func (*UserPreferences) CopyOrDefault ¶
func (p *UserPreferences) CopyOrDefault() *UserPreferences
func (*UserPreferences) IsModuleSpecifierExcluded ¶
func (p *UserPreferences) IsModuleSpecifierExcluded(moduleSpecifier string) bool
func (*UserPreferences) ModuleSpecifierPreferences ¶
func (p *UserPreferences) ModuleSpecifierPreferences() modulespecifiers.UserPreferences
func (*UserPreferences) OrDefault ¶
func (p *UserPreferences) OrDefault() *UserPreferences
func (*UserPreferences) ParseWorker ¶
func (p *UserPreferences) ParseWorker(config map[string]any) *UserPreferences
func (*UserPreferences) ParsedAutoImportFileExcludePatterns ¶
func (p *UserPreferences) ParsedAutoImportFileExcludePatterns(useCaseSensitiveFileNames bool) []*regexp2.Regexp