Skip to content

Commit 7353bcd

Browse files
committed
add initial mdpopups implementation
1 parent 3521416 commit 7353bcd

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

dependencies.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"*": {
3+
">=3080": [
4+
"pygments",
5+
"python-markdown",
6+
"mdpopups",
7+
"python-jinja2",
8+
"markupsafe"
9+
]
10+
}
11+
}

flow.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import sublime, sublime_plugin
66
from .haxe_parse_completion_list import *
7+
import mdpopups
78

89
#plugin location
910
plugin_file = __file__
@@ -186,18 +187,23 @@ def show_errors(self, view, errs):
186187
if not errs:
187188
return None
188189

189-
_style = '<style></style>'
190-
view.show_popup(_style + '<b>&gt; </b>' + '<br><b>&gt; </b>'.join(errs), max_width=640)
190+
_pre = '<span class="invalid">&nbsp;Haxe Errors&nbsp;</span><br><br>'
191+
mdpopups.show_popup(view, _pre + '\n'.join(errs), max_width=1280)
191192

192193
def show_args(self, view, args):
193194

194195
if not args:
195196
return []
196197

197-
# print('[flow] args ' + args)
198+
print('[flow] args ' + args)
199+
_res = []
200+
_list = args.split(', ')
201+
for _arg in _list:
202+
_parts = _arg.split(':')
203+
_res.append('<span class="entity name">' + _parts[0] + '</span>:<span class="storage type">' + _parts[1] + '</span>')
198204

199-
_style = '<style>font-size:0.5em;</style>'
200-
view.show_popup(_style + args, max_width=640)
205+
args = '<div>'+', '.join(_res)+'</div>'
206+
mdpopups.show_popup(view, args, max_width=1280)
201207

202208
return None
203209

haxe_parse_completion_list.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def parse_type(_type):
126126
if len(node) > 1:
127127
_typename = node[1]
128128

129-
_list.append(sanitize(_name) + ':' + sanitize(_typename))
129+
_list.append(sanitize(_name.strip()) + ':' + sanitize(_typename.strip()))
130130

131131
return ', '.join(_list)
132132

0 commit comments

Comments
 (0)