MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getCompletionTypeFromPrefix

Function getCompletionTypeFromPrefix

src/utils/bash/shellCompletion.ts:38–50  ·  view source on GitHub ↗

* Determine completion type based solely on prefix characteristics

(prefix: string)

Source from the content-addressed store, hash-verified

36 * Determine completion type based solely on prefix characteristics
37 */
38function getCompletionTypeFromPrefix(prefix: string): ShellCompletionType {
39 if (prefix.startsWith('$')) {
40 return 'variable'
41 }
42 if (
43 prefix.includes('/') ||
44 prefix.startsWith('~') ||
45 prefix.startsWith('.')
46 ) {
47 return 'file'
48 }
49 return 'command'
50}
51
52/**
53 * Find the last string token and its index in parsed tokens

Callers 1

parseInputContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected