This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as atomIde from 'atom-ide';
22import Convert from '../convert' ;
33import Utils from '../utils' ;
44import {
5+ Hover ,
56 LanguageClientConnection ,
67 MarkupContent ,
78 MarkedString ,
@@ -43,12 +44,7 @@ export default class DatatipAdapter {
4344 const documentPositionParams = Convert . editorToTextDocumentPositionParams ( editor , point ) ;
4445
4546 const hover = await connection . hover ( documentPositionParams ) ;
46- if (
47- hover == null ||
48- hover . contents == null ||
49- ( typeof hover . contents === 'string' && hover . contents . length === 0 ) ||
50- ( Array . isArray ( hover . contents ) && hover . contents . length === 0 )
51- ) {
47+ if ( hover == null || DatatipAdapter . isEmptyHover ( hover ) ) {
5248 return null ;
5349 }
5450
@@ -62,6 +58,13 @@ export default class DatatipAdapter {
6258 return { range, markedStrings } ;
6359 }
6460
61+ private static isEmptyHover ( hover : Hover ) : boolean {
62+ return hover . contents == null ||
63+ ( typeof hover . contents === 'string' && hover . contents . length === 0 ) ||
64+ ( Array . isArray ( hover . contents ) &&
65+ ( hover . contents . length === 0 || hover . contents [ 0 ] === "" ) ) ;
66+ }
67+
6568 private static convertMarkedString (
6669 editor : TextEditor ,
6770 markedString : MarkedString | MarkupContent ,
You can’t perform that action at this time.
0 commit comments