MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / createNoteCompletions

Function createNoteCompletions

packages/lsp/src/server/completion.ts:259–284  ·  view source on GitHub ↗
(
    beat: alphaTab.importer.alphaTex.AlphaTexBeatNode,
    note: alphaTab.importer.alphaTex.AlphaTexNoteNode,
    offset: number,
    endOfNote: number
)

Source from the content-addressed store, hash-verified

257}
258
259function createNoteCompletions(
260 beat: alphaTab.importer.alphaTex.AlphaTexBeatNode,
261 note: alphaTab.importer.alphaTex.AlphaTexNoteNode,
262 offset: number,
263 endOfNote: number
264): CompletionItem[] {
265 const completions: CompletionItem[] = [];
266 if (note.noteEffects && note.noteEffects.start!.offset < offset && note.noteEffects.end!.offset) {
267 const endOfProperties = note.noteEffects.closeBrace?.start?.offset ?? endOfNote;
268
269 if (beat.notes!.notes.length === 1) {
270 completions.splice(
271 0,
272 0,
273 ...createPropertiesCompletions(note.noteEffects, offset, beatProperties, endOfProperties)
274 );
275 }
276
277 completions.splice(
278 0,
279 0,
280 ...createPropertiesCompletions(note.noteEffects, offset, noteProperties, endOfProperties)
281 );
282 }
283 return completions;
284}
285
286function propertyToCompletion(p: PropertyDefinition, more?: Partial<CompletionItem>): CompletionItem {
287 return {

Callers 1

createBeatCompletionsFunction · 0.85

Calls 2

spliceMethod · 0.45

Tested by

no test coverage detected