def show_doc_popup(self, view, point, word):
if not word in functions:
return
max_width, max_height = 600, 300
word = word.replace("_","-")
filepath = re.sub("{{.*?}}",word,self.settings.get('pathToPHPDocs'))
print(filepath)
html_file = filepath
html_str = sublime.load_resource(html_file)
html_str = re.sub("<!DOCTYPE.*?>","",html_str)
#strip Meta tag
html_str = re.sub("<meta .*?>","",html_str)
#remove entities that python has trouble with from what I saw
html_str = re.sub("—","-",html_str)
html_str = re.sub(""",'"',html_str)
html_str = re.sub("'","'",html_str)
html_str = re.sub("»","»",html_str)
#replace &$ with entity many functions had this
html_str = re.sub("&\$","&$",html_str)
#remove all spans
html_str = re.sub("<span.*?>(.*?)</span>",r"\1",html_str)
html_str = re.sub("<head>","",html_str)
html_str = re.sub("</head>","",html_str)
view.show_popup(html_str,
sublime.HIDE_ON_MOUSE_MOVE_AWAY,
point,
max_width,
max_height,
lambda s: self.on_navigate(s, view, point),
)
print("here")
CompletePHPInlineDocsHover.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录