carlitux / deoplete-ternjs

deoplete.nvim source for javascript
MIT License
277 stars 24 forks source link

Add configuration for not displaying the function doc #21

Closed polarlights closed 8 years ago

polarlights commented 8 years ago

As I don't want to the doc info popup window when I choose one completion, I don't know python well neither. I tried to edit rplugin/python3/deoplete/sources/ternjs.p#type_doc and make it return just empty string. It doesn't popup the function doc information. However, it became very slow, even didn't show the completion.

Would you give me any suggestions? Thank you in advance.

carlitux commented 8 years ago

Do you have the code you did to see?

polarlights commented 8 years ago

I'm sorry for that I didn't figure it out exactly.

Now here it is.

typedoc

def type_doc(self, rec):
        tp = rec.get("type")
        result = rec.get("doc", " ")
        if tp and tp != "?":
            result = tp + "\n" + result
        return result

It's called at here in completation

 if data is not None:

            for rec in data["completions"]:
                completions.append({"word": rec["name"],
                                    "menu": self.completion_icon(rec.get("type")),
                                    "info": self.type_doc(rec)})
carlitux commented 8 years ago

Well you have to key: value in line https://github.com/carlitux/deoplete-ternjs/blob/master/rplugin/python3/deoplete/sources/ternjs.py#L328... but also depends on how deoplete handle that missed key:value

I hope that solves your requirement.

polarlights commented 8 years ago

thanks. I'll check it out. :)