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

Function codeActionKindContains

internal/ls/codeactions.go:234–238  ·  view source on GitHub ↗

codeActionKindContains returns true if the requested kind equals or is a hierarchical parent of actionKind, using '.' as the separator. This matches the semantics of VS Code's HierarchicalKind.contains.

(requestedKind, actionKind lsproto.CodeActionKind)

Source from the content-addressed store, hash-verified

232// hierarchical parent of actionKind, using '.' as the separator. This matches
233// the semantics of VS Code's HierarchicalKind.contains.
234func codeActionKindContains(requestedKind, actionKind lsproto.CodeActionKind) bool {
235 return requestedKind == actionKind ||
236 requestedKind == "" ||
237 strings.HasPrefix(string(actionKind), string(requestedKind)+".")
238}
239
240// isFixAllKind returns true if the requested kind matches source.fixAll
241func isFixAllKind(kind lsproto.CodeActionKind) bool {

Callers 3

isFixAllKindFunction · 0.85
wantsQuickFixesFunction · 0.85

Calls 1

stringEnum · 0.50

Tested by

no test coverage detected