Repository: sublimelsp/LSP

Issue:
When a completionItem/resolve request returns nothing, tell the user that there's no docs
When a langserver fetches completion docs through the completionItem/resolve request, there will always be a "More" link in the AC widget. It can be the case that the server returns no docs. In that case, pressing F12 or clicking on the link does not show a popup. This confuses me (and probably other users). It should instead show something along the lines of "No documentation available".


Discussion:
Can you point me to a server that shows a `more` link but when you click it it does nothing?
I tried with LSP-typescript, pyls, LSP-css, cannot find any completion item that does what you have described.
At least elixir-ls and metals have this behavior.
I've seen that happen also with the servers I'm using but can't tell which one now.
Just a note. while I was intalling LSP-metals on the latest st-4000 branch

I got this error message:
```
Failed to register plugin
Traceback (most recent call last):
  File "/home/predrag/.config/sublime-text/Packages/LSP/plugin/core/sessions.py", line 446, in register_plugin
    client_configs.add_external_config(name, *plugin.configuration())
  File "/home/predrag/.config/sublime-text/Packages/LSP/plugin/core/settings.py", line 119, in add_external_config
    base = sublime.decode_value(sublime.load_resource(file))
  File "/opt/sublime_text/Lib/python33/sublime.py", line 240, in load_resource
    raise IOError('resource "%s" not found' % name)
OSError: resource "Packages/metals-sublime/metals-sublime.sublime-settings" not found
```

The actual path should be `Packages/LSP-metals/metals-sublime.sublime-settings.

@ayoub-benali I also saw in `Main.sublime-menu` that you are using 
```
"base_file": "${packages}/metals-sublime/metals-sublime.sublime-settings",
``` 
But It should be: 
```
"base_file": "${packages}/LSP-metals/metals-sublime.sublime-settings",
```

I specifically checked metals-sublime for the AbstractPlugin API and it worked. It looks like your folder is called “LSP-metals” for some reason, but it should be called “metals-sublime”. At least, that’s what it’s called when you check out the repo via git. Is it called “LSP-metals” when you install it via package control?
Package controls has it as:
```
			"name": "LSP-metals",
			"details": "https://github.com/scalameta/metals-sublime",
```
This is an interesting problem. It would have to be fixed on metals’ side because there’s no way (at least I think so, but I have been proven wrong many times) for the transitional language handler to know that it’s a different package name when installed through package control.
Ultimately the best thing to do is to check the API version and implement either AbstractPlugin or LanguageHandler
Just caught the discussion, the Metals LSP language handler repo is at https://github.com/scalameta/metals-sublime for historic reasons but I named the package `LSP-metals` to stay consistant with the other `LSP-*` packages and at the time I was told it wasn't a problem.

> It would have to be fixed on metals’ side

Should I make the changes that @predragnikolic suggested ?


Yes, for the paths to work correctly they have to match the directory structure of the released package.

For manual checkouts you should probably just specify in the readme that one has to specify a directory name to be `LSP-metals` when checking out. So:

```
git clone [URL] LSP-metals
```

Resolving patch:
diff --git a/plugin/completion.py b/plugin/completion.py
--- a/plugin/completion.py
+++ b/plugin/completion.py
@@ -65,10 +65,13 @@ def do_resolve(self, item: dict) -> None:
                 lambda res: self.handle_resolve_response(res))
 
     def handle_resolve_response(self, item: Optional[dict]) -> None:
-        if not item:
-            return
-        detail = self.format_documentation(item.get('detail') or "")
-        documentation = self.format_documentation(item.get("documentation") or "")
+        detail = ""
+        documentation = ""
+        if item:
+            detail = self.format_documentation(item.get('detail') or "")
+            documentation = self.format_documentation(item.get("documentation") or "")
+        if not documentation:
+            documentation = "<i>No documentation available.</i>"
         minihtml_content = self.get_content(documentation, detail)
         show = self.update_popup if self.view.is_popup_visible() else self.show_popup
         # NOTE: Update/show popups from the main thread, or else the popup might make the AC widget disappear.


Test patch: