-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What do package writers need to do to support this? #28
Comments
I hook into |
|
If the company API has changed recently then that might be the case. I haven't made any changes to this package in a good while. |
It did :) Thanks for your explanation. The changes required should be pretty minimal IIUC (instead of taking the text of the whole buffer, you would only take the text starting from a given offset) |
What do you want me to do here? Just fill the popup with the text starting from that buffer location? It seems that might give you quite a bit of irrelevant text. AFAIK |
Filling the popup from that buffer location and truncating if it gets too long sounds reasonable :) I don't think I'll have time to prepare a PR for now, but I'll keep it in mind; I haven't been looking at this issue further. |
It would be cool if you found the time to test this @cpitclaudel. When that's done I'll push a new tag for |
It almost works; the doc buffer is still shown for every candidate (which is not surprising: company-coq explicitly displays it when Is there a way for me to detect that the call to Another issue that I'm seeing is that text properties (in particular composition) are not preserved. Should this be another bug report, or is it expected? |
Not at the moment. You're not really adhering to the API if a request for the doc-buffer has unwanted side-effects. If you can't think of a way to rewrite that part of the backend I'll add a dynamic var you can check for.
This is to be expected. It's just an instance of defensive coding. I'm using |
I don't think the API defines which side-effects are unwanted :) I could try to find a workaround.
I'll try it out. |
Unrelated: the loop in |
Ah, never mind, things are still broken actually:
|
Random thought: what would you think of a |
Regarding the fontification: |
Is this a problem for you? For most usage
I've solved this. I forgot that you pull stuff out of
This would be cool. \cc @dgutov |
Thanks for the fix. And complexity doesn't seem to be too much of a problem :) |
Why? Just call |
@dgutov I don't understand your answer :/ |
You can convert from a string to a buffer, and back, pretty easily. |
Ah, I understand now. Thanks. What I'm proposing is a middle ground between 'meta and 'doc-buffer. 'meta is very short and very plain. 'doc-buffer can be arbitrarily very elaborate. The proposed change wouldn't require updating existing backends; 'doc-buffer would be used instead of doc-string if the wasn't available. But 'doc-string would be a way to give bacends information about the context in which the documentation will be displayed. In the concrete case of company-coq, doc-buffer returns a buffer constructed by rendering an HTML document. I add a title, I highlight some parts of the document to make them stand out, I apply syntax highlighting to other parts, I enable prettify-symbols-mode, etc. doc-string, if it existed, would do a much less invasive version of the same thing: less fontification (bold and prettify-symbols-mode, , but no larger faces and no overlays). More practically: due to the setting in which company-coq is used, I need to force the buffer to display in a specific window; thus doc-buffer aggressively displays the buffer. Calling doc-string wouldn't cause anything to be displayed. |
Why?
So, do you actually want |
No; I'm thinking of two different and independent backend commands, with the expectation that one could in most cases be implemented in terms of the other.
This is definitely true. But your input on these matters is both valuable and welcome :) Your efforts on company are responsible for large gains in popularity and adoption, so it seems reasonable to ask you for insight about this. Maybe I've missed something, or maybe there's a different approach that you could suggest, or... But yeah, this isn't about changing company; just about getting your opinion on something that uses company. |
In that case, I think
Do you see any problems with the above? |
No, it sounds great. Sorry that it took me a year to notice that I essentially dropped this discussion. @expez Would you take a PR? I've come across another case today where I needed this. As a refresher, here's a description of the issue:
And here's a description of the proposed solution
🚦 ? |
Sure, that's fine. In general, I think it would be a lot better to just clean up the doc buffer, though. I don't see why you'd want e.g. that that long file path as part of the documentation. By cleaning up the doc buffer, all the people who prefer hitting F1 and getting a regular help popup would also benefit :) |
It helps you see which file a symbol was resolved from, which tends to be be an issue sometimes. Since the doc buffer is a lot larger that pop-ups, I feel that it's OK to show more information in it :)
PR incoming! :) |
This package looks cool, so I'd love to have support for it in
company-coq
. Unfortunately, it doesn't seem to work out of the box: usingM-h
yields:Hovering on candidates just shows the documentation buffer (company-coq displays the window by itself, so that's expected, but no pos-tip window is shown).
The text was updated successfully, but these errors were encountered: