facelessuser / sublime-markdown-popups

Markdown popup dependency for Sublime
https://facelessuser.github.io/sublime-markdown-popups/
Other
112 stars 13 forks source link

failed to create the popup/phantom (during "signature help" request of LSP) #49

Closed rwols closed 7 years ago

rwols commented 7 years ago
schermafbeelding 2017-11-11 om 16 12 50

Indeed, there are some hints in the console:

LSP:      {'activeSignature': 0, 'signatures': [{'label': 'parse(llvm::yaml::MappingNode *Params, clangd::Logger &Logger) -> llvm::Optional<WorkspaceEdit>', 'parameters': [{'label': 'llvm::yaml::MappingNode *Params'}, {'label': 'clangd::Logger &Logger'}]}], 'activeParameter': 0}
mdpopups: Failed to convert/retrieve scheme to CSS!
mdpopups: Failed to get Sublime highlighter object!
mdpopups: Traceback (most recent call last):
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/__init__.py", line 609, in show_popup
    nl2br=nl2br, allow_code_wrap=allow_code_wrap
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/__init__.py", line 327, in _create_html
    allow_code_wrap=allow_code_wrap
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/__init__.py", line 445, in md2html
    ).convert(_markup_template(markup, template_vars, template_env_options)).replace('&quot;', '"').replace('\n', '')
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/__init__.py", line 368, in convert
    self.lines = prep.run(self.lines)
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/mdx/superfences.py", line 502, in run
    lines = self.search_nested(lines)
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/mdx/superfences.py", line 422, in search_nested
    self.eval(m, start, end)
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/mdx/superfences.py", line 312, in eval
    self.process_nested_block(m, start, end)
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/mdx/superfences.py", line 351, in process_nested_block
    code = entry["formatter"](self.rebuild_block(self.code), self.lang)
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/mdx/superfences.py", line 469, in highlight
    linespecial=linespecial
  File "/Users/raoulwols/Library/Application Support/Sublime Text 3/Packages/mdpopups/st3/mdpopups/mdx/highlight.py", line 324, in highlight
    code = self.sublime_hl[1].syntax_highlight(
AttributeError: 'NoneType' object has no attribute 'syntax_highlight'

macOS 10.12, Build 3154, 64 bit.

Hope this helps!

facelessuser commented 7 years ago

Mdpopups version?

rwols commented 7 years ago
>>> import mdpopups
>>> mdpopups.version()
(2, 2, 0)
facelessuser commented 7 years ago

You need to upgrade your dependencies. Despite what is claimed, Package Control does not often update dependencies as it should. You are pretty far behind.

rwols commented 7 years ago

Strange, I'm pretty certain I upgraded last time I had this problem.

Package Control: The dependency 'mdpopups' is installed, but out of date; upgrading to latest release 3.1.3 from 2.2.0...

Anyway, I still have no highlighting at the moment. But that's okay. You can close this if you want.

facelessuser commented 7 years ago

What do you mean no highlighting? Did you restart after upgrade?

facelessuser commented 7 years ago

Also, you can download this package https://github.com/facelessuser/mdpopup_test.

Run the basic test (look for the Mdpopups commands in the palette). Don't bother with the UML command as that requires other installation. If that pops up okay, then we are good. I support mdpopups directly, and my packages that use it, but I don't directly support LSP as that is not my package. They may be doing something wrong.

rwols commented 7 years ago

Yes, we had this exact same conversation a while a go. Perhaps it's a regression in LSP.

This should in principle have highlighting from a syntax file:

schermafbeelding 2017-11-11 om 19 06 11

I just figured out the problem; the languageId is set to c-family but it should be set to objc++. I remember that this got fixed but maybe something went awry during the great refactor.

facelessuser commented 7 years ago

Cool, so it's a LSP issue, right? If so, feel free to close this issue.