MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getModifierOccurrences

Function getModifierOccurrences

internal/ls/documenthighlights.go:681–692  ·  view source on GitHub ↗
(kind ast.Kind, node *ast.Node, sourceFile *ast.SourceFile)

Source from the content-addressed store, hash-verified

679}
680
681func getModifierOccurrences(kind ast.Kind, node *ast.Node, sourceFile *ast.SourceFile) []*ast.Node {
682 var result []*ast.Node
683
684 nodesToSearch := getNodesToSearchForModifier(node, ast.ModifierToFlag(kind))
685 for _, n := range nodesToSearch {
686 modifier := findModifier(n, kind)
687 if modifier != nil {
688 result = append(result, modifier)
689 }
690 }
691 return result
692}
693
694func getNodesToSearchForModifier(declaration *ast.Node, modifierFlag ast.ModifierFlags) []*ast.Node {
695 var result []*ast.Node

Callers 1

Calls 4

ModifierToFlagFunction · 0.92
findModifierFunction · 0.85
appendFunction · 0.50

Tested by

no test coverage detected