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

Function createPropertiesHover

packages/lsp/src/server/hover.ts:124–160  ·  view source on GitHub ↗
(
    properties: alphaTab.importer.alphaTex.AlphaTexPropertiesNode,
    propertiesDocs: Map<string, PropertyDefinition> | Map<string, PropertyDefinition>[],
    offset: number
)

Source from the content-addressed store, hash-verified

122}
123
124function createPropertiesHover(
125 properties: alphaTab.importer.alphaTex.AlphaTexPropertiesNode,
126 propertiesDocs: Map<string, PropertyDefinition> | Map<string, PropertyDefinition>[],
127 offset: number
128): Hover | null {
129 const prop = binaryNodeSearch(properties.properties, offset);
130 if (prop) {
131 let propDocs: PropertyDefinition | undefined;
132 if (Array.isArray(propertiesDocs)) {
133 for (const d of propertiesDocs) {
134 propDocs = d.get(prop.property.text.toLowerCase());
135 if (propDocs) {
136 break;
137 }
138 }
139 } else {
140 propDocs = propertiesDocs.get(prop.property.text.toLowerCase());
141 }
142
143 if (propDocs) {
144 if (prop.property.start!.offset <= offset && offset <= prop.property.end!.offset) {
145 return {
146 contents: {
147 kind: 'markdown',
148 value: withSignaturesToMarkdown(propDocs, propDocs.property)
149 }
150 };
151 } else if (prop.arguments) {
152 const hover = createArgumentsHover(prop.arguments, propDocs.signatures, offset);
153 if (hover) {
154 return hover;
155 }
156 }
157 }
158 }
159 return null;
160}
161
162function valueToText(value: alphaTab.importer.alphaTex.IAlphaTexArgumentValue): string {
163 switch (value.nodeType) {

Callers 3

createMetaDataHoverFunction · 0.85
createBeatHoverFunction · 0.85
createNoteHoverFunction · 0.85

Calls 5

binaryNodeSearchFunction · 0.90
withSignaturesToMarkdownFunction · 0.85
createArgumentsHoverFunction · 0.85
isArrayMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected