(
durationChange: alphaTab.importer.alphaTex.AlphaTexBeatDurationChangeNode,
offset: number,
endOfDurationChange: number
)
| 213 | } |
| 214 | |
| 215 | function createDurationChangeCompletions( |
| 216 | durationChange: alphaTab.importer.alphaTex.AlphaTexBeatDurationChangeNode, |
| 217 | offset: number, |
| 218 | endOfDurationChange: number |
| 219 | ): CompletionItem[] { |
| 220 | const completions: CompletionItem[] = []; |
| 221 | |
| 222 | if (!durationChange.properties || offset < durationChange.properties.start!.offset) { |
| 223 | const endOfValue = durationChange.properties?.start ?? durationChange.end!; |
| 224 | const replacement: TextEdit[] | undefined = durationChange.properties |
| 225 | ? [ |
| 226 | TextEdit.del({ |
| 227 | start: { |
| 228 | line: durationChange.colon.start!.line - 1, |
| 229 | character: durationChange.colon.start!.col - 1 |
| 230 | }, |
| 231 | end: { |
| 232 | line: endOfValue.line - 1, |
| 233 | character: endOfValue.col - 1 |
| 234 | } |
| 235 | }) |
| 236 | ] |
| 237 | : undefined; |
| 238 | |
| 239 | completions.push( |
| 240 | ...durationCompletionItems.map(d => ({ |
| 241 | ...d, |
| 242 | additionalTextEdits: replacement |
| 243 | })) |
| 244 | ); |
| 245 | } else if ( |
| 246 | durationChange.properties && |
| 247 | durationChange.properties.start!.offset < offset && |
| 248 | durationChange.properties.end!.offset |
| 249 | ) { |
| 250 | const endOfProperties = durationChange.properties?.closeBrace?.start?.offset ?? endOfDurationChange; |
| 251 | completions.push( |
| 252 | ...createPropertiesCompletions(durationChange.properties, offset, durationChangeProperties, endOfProperties) |
| 253 | ); |
| 254 | } |
| 255 | |
| 256 | return completions; |
| 257 | } |
| 258 | |
| 259 | function createNoteCompletions( |
| 260 | beat: alphaTab.importer.alphaTex.AlphaTexBeatNode, |
no test coverage detected