MCPcopy Index your code
hub / github.com/SplootCode/splootcode / getShortDoc

Function getShortDoc

packages/runtime-python/src/autocomplete.ts:18–35  ·  view source on GitHub ↗
(docString?: string)

Source from the content-addressed store, hash-verified

16} from 'structured-pyright'
17
18export function getShortDoc(docString?: string) {
19 if (!docString) {
20 return ''
21 }
22
23 const lines = docString.split('\n')
24
25 let short = lines.find((line) => line.trim().length > 0)
26 if (!short) {
27 return ''
28 }
29
30 if (short.length > 100) {
31 short = short.slice(0, 97) + '...'
32 }
33
34 return short
35}
36
37function pyrightParamsToAutocompleteFunctionArguments(
38 params: FunctionParameter[]

Callers 2

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected