(
parentItemLabel: string,
docs: WithSignatures,
values: alphaTab.importer.alphaTex.AlphaTexArgumentList | undefined,
offset: number
)
| 146 | } |
| 147 | |
| 148 | function createArgumentsSignatureHelp( |
| 149 | parentItemLabel: string, |
| 150 | docs: WithSignatures, |
| 151 | values: alphaTab.importer.alphaTex.AlphaTexArgumentList | undefined, |
| 152 | offset: number |
| 153 | ): SignatureHelp | null { |
| 154 | const help: SignatureHelp = { |
| 155 | signatures: docs.signatures.map(s => signatureDefinitionToHelp(parentItemLabel, docs, s)), |
| 156 | activeSignature: undefined, |
| 157 | activeParameter: undefined |
| 158 | }; |
| 159 | |
| 160 | if (!values) { |
| 161 | return help; |
| 162 | } |
| 163 | |
| 164 | if (values.signatureCandidateIndices !== undefined) { |
| 165 | help.activeSignature = values.signatureCandidateIndices[0]; |
| 166 | const value = binaryNodeSearch(values.arguments, offset); |
| 167 | if (value) { |
| 168 | if (value.parameterIndices !== undefined) { |
| 169 | for (const [signatureIndex, parameterIndex] of value.parameterIndices) { |
| 170 | if (parameterIndex >= 0) { |
| 171 | help.signatures[signatureIndex].activeParameter = parameterIndex; |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | return help; |
| 179 | } |
| 180 | |
| 181 | function createParameterInfo(signature: SignatureInformation, doc: ParameterDefinition) { |
| 182 | const start = signature.label.length; |
no test coverage detected