Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f1616c3
porting folding
navya9singh Jun 23, 2025
c32bbb7
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Jun 23, 2025
c691b7d
adding all tests
navya9singh Jun 30, 2025
02723d4
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Jun 30, 2025
1938da6
code clean up
navya9singh Jun 30, 2025
86df138
cleanup
navya9singh Jun 30, 2025
37babb6
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Jun 30, 2025
18a2737
adding check for binary expression
navya9singh Jul 1, 2025
b7b020f
addressing pr comments
navya9singh Jul 3, 2025
dd3f93d
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Jul 3, 2025
7435726
fixing test
navya9singh Jul 3, 2025
3527adb
using sourceFile.endOfFileToken
navya9singh Jul 3, 2025
3a1f476
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Jul 7, 2025
08fbeda
addressing pr comments
navya9singh Jul 7, 2025
30f9df7
addressing comments
navya9singh Jul 8, 2025
f68abaa
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Jul 8, 2025
60e21ce
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Jul 15, 2025
356383f
addressing comments
navya9singh Jul 15, 2025
65e981f
adding defined capacity
navya9singh Jul 15, 2025
35ea0dc
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Aug 5, 2025
c849009
addressing comments
navya9singh Aug 5, 2025
276316b
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Nov 6, 2025
404e94f
updating the pr
navya9singh Nov 25, 2025
633bc8b
adding fourslash tests
navya9singh Nov 25, 2025
4737bbd
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Nov 25, 2025
927e872
addressing pr comments
navya9singh Dec 2, 2025
2ba4dcf
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Dec 2, 2025
21cc988
fixing comparison function
navya9singh Dec 2, 2025
2592640
Merge branch 'main' of https://github.com/navya9singh/typescript-go-r…
navya9singh Dec 2, 2025
07d51aa
Porting differences copilot noticed
jakebailey Dec 2, 2025
6a54dbc
Remove spanForNodeWithHintSpan accidental addition
jakebailey Dec 2, 2025
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
45 changes: 44 additions & 1 deletion internal/ast/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,49 @@ func isDeclarationStatementKind(kind Kind) bool {
return false
}

func isDeclarationKind(kind Kind) bool {
switch kind {
case KindArrowFunction,
KindBindingElement,
KindClassDeclaration,
KindClassExpression,
KindClassStaticBlockDeclaration,
KindConstructor,
KindEnumDeclaration,
KindEnumMember,
KindExportSpecifier,
KindFunctionDeclaration,
KindFunctionExpression,
KindGetAccessor,
KindImportClause,
KindImportEqualsDeclaration,
KindImportSpecifier,
KindInterfaceDeclaration,
KindJsxAttribute,
KindMethodDeclaration,
KindMethodSignature,
KindModuleDeclaration,
KindNamespaceExportDeclaration,
KindNamespaceExport,
KindNamespaceImport,
KindParameter,
KindPropertyAssignment,
KindPropertyDeclaration,
KindPropertySignature,
KindSetAccessor,
KindShorthandPropertyAssignment,
KindTypeAliasDeclaration,
KindTypeParameter,
KindVariableDeclaration,
KindJSDocTypedefTag,
KindJSDocCallbackTag,
KindJSDocPropertyTag,
KindNamedTupleMember:
return true
}
return false
}

// Determines whether a node is a DeclarationStatement. Ideally this does not use Parent pointers, but it may use them
// to rule out a Block node that is part of `try` or `catch` or is the Block-like body of a function.
//
Expand Down Expand Up @@ -1265,7 +1308,7 @@ func IsDeclaration(node *Node) bool {
if node.Kind == KindTypeParameter {
return node.Parent != nil
}
return IsDeclarationNode(node)
return isDeclarationKind(node.Kind)
}

// True if `name` is the name of a declaration node
Expand Down
Loading
Loading