Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27691,7 +27691,7 @@ func (c *Checker) markJsxAliasReferenced(node *ast.Node /*JsxOpeningLikeElement
// Mark local symbol as referenced here because it might not have been marked
// if jsx emit was not jsxFactory as there wont be error being emitted
c.symbolReferenced(jsxFactorySym, ast.SymbolFlagsAll)
// If react/jsxFactory symbol is alias, mark it as refereced
// If react/jsxFactory symbol is alias, mark it as referenced
if c.canCollectSymbolAliasAccessibilityData && jsxFactorySym.Flags&ast.SymbolFlagsAlias != 0 && c.getTypeOnlyAliasDeclaration(jsxFactorySym) == nil {
c.markAliasSymbolAsReferenced(jsxFactorySym)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/checker/jsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ func (c *Checker) getJsxManagedAttributesFromLocatedAttributes(context *ast.Node

func (c *Checker) instantiateAliasOrInterfaceWithDefaults(managedSym *ast.Symbol, typeArguments []*Type, inJavaScript bool) *Type {
declaredManagedType := c.getDeclaredTypeOfSymbol(managedSym)
// fetches interface type, or initializes symbol links type parmaeters
// fetches interface type, or initializes symbol links type parameters
if managedSym.Flags&ast.SymbolFlagsTypeAlias != 0 {
params := c.typeAliasLinks.Get(managedSym).typeParameters
if len(params) >= len(typeArguments) {
Expand Down
2 changes: 1 addition & 1 deletion internal/ls/change/trackerimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (t *Tracker) getEndPositionOfMultilineTrailingComment(sourceFile *ast.Sourc
nodeEndLine := scanner.ComputeLineOfPosition(lineStarts, node.End())
for comment := range scanner.GetTrailingCommentRanges(t.NodeFactory, sourceFile.Text(), node.End()) {
// Single line can break the loop as trivia will only be this line.
// Comments on subsequest lines are also ignored.
// Comments on subsequent lines are also ignored.
if comment.Kind == ast.KindSingleLineCommentTrivia || scanner.ComputeLineOfPosition(lineStarts, comment.Pos()) > nodeEndLine {
break
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ls/documenthighlights.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (l *LanguageService) ProvideDocumentHighlights(ctx context.Context, documen
if len(documentHighlights) == 0 {
documentHighlights = l.getSyntacticDocumentHighlights(node, sourceFile)
}
// if nil is passed here we never generate an error, just pass an empty higlight
// if nil is passed here we never generate an error, just pass an empty highlight
return lsproto.DocumentHighlightsOrNull{DocumentHighlights: &documentHighlights}, nil
}

Expand Down
6 changes: 3 additions & 3 deletions internal/ls/organizeimports/organizeimports.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func getImportKindOrder(s1 *ast.Statement) int {
}
}

// compareImportsOrRequireStatements compares two import or require statements for sorting
// CompareImportsOrRequireStatements compares two import or require statements for sorting
func CompareImportsOrRequireStatements(s1 *ast.Statement, s2 *ast.Statement, comparer func(a, b string) int) int {
if cmp := compareModuleSpecifiersWorker(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s2), comparer); cmp != 0 {
return cmp
Expand Down Expand Up @@ -172,14 +172,14 @@ func GetNamedImportSpecifierComparer(preferences *lsutil.UserPreferences, compar
}
}

// getImportSpecifierInsertionIndex finds the insertion index for a new import specifier
// GetImportSpecifierInsertionIndex finds the insertion index for a new import specifier
func GetImportSpecifierInsertionIndex(sortedImports []*ast.Node, newImport *ast.Node, comparer func(s1, s2 *ast.Node) int) int {
return core.FirstResult(core.BinarySearchUniqueFunc(sortedImports, func(mid int, value *ast.Node) int {
return comparer(value, newImport)
}))
}

// getOrganizeImportsStringComparerWithDetection detects the string comparer to use based on existing imports
// GetOrganizeImportsStringComparerWithDetection detects the string comparer to use based on existing imports
func GetOrganizeImportsStringComparerWithDetection(originalImportDecls []*ast.Statement, preferences *lsutil.UserPreferences) (comparer func(a, b string) int, isSorted bool) {
result := detectModuleSpecifierCaseBySort([][]*ast.Statement{originalImportDecls}, getComparers(preferences))
return result.comparer, result.isSorted
Expand Down