Skip to content

Commit e3a2459

Browse files
committed
fix: fix view.element type
1 parent 31a49f0 commit e3a2459

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/signature-help-manager.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,18 +273,20 @@ export class SignatureHelpManager {
273273
* @return a composite object to release references at a later stage
274274
*/
275275
mountSignatureHelp(editor: TextEditor, position: Point, view: ViewContainer) {
276+
const element = view.element as HTMLElement
277+
276278
let disposables = new CompositeDisposable()
277279
const overlayMarker = editor.markBufferRange(new Range(position, position), {
278280
invalidate: "overlap", // TODO It was never. Shouldn't be surround?
279281
})
280282

281-
makeOverlaySelectable(editor, view.element)
283+
makeOverlaySelectable(editor, element)
282284

283285
const marker = editor.decorateMarker(overlayMarker, {
284286
type: "overlay",
285287
class: "signature-overlay",
286288
position: "head", // follows the cursor
287-
item: view.element,
289+
item: element,
288290
})
289291

290292
// TODO do this for some valid range
@@ -295,11 +297,11 @@ export class SignatureHelpManager {
295297
// move box above the current editing line
296298
// HACK: patch the decoration's style so it is shown above the current line
297299
setTimeout(() => {
298-
const overlay = view.element.parentElement
300+
const overlay = element.parentElement
299301
if (!overlay) {
300302
return
301303
}
302-
const hight = view.element.getBoundingClientRect().height
304+
const hight = element.getBoundingClientRect().height
303305
const lineHight = editor.getLineHeightInPixels()
304306
//@ts-ignore internal type
305307
const availableHight = (position.row - editor.getFirstVisibleScreenRow()) * lineHight
@@ -317,7 +319,7 @@ export class SignatureHelpManager {
317319
overlay.style.transform = "translateX(300px)"
318320
}
319321
}
320-
view.element.style.visibility = "visible"
322+
element.style.visibility = "visible"
321323
}, 100)
322324

323325
disposables.add(

0 commit comments

Comments
 (0)