tonka3000 / vscode-qt-tools

Qt tools extension for Visual Studio Code
MIT License
41 stars 10 forks source link

Online help for methods #91

Open srcejon opened 1 year ago

srcejon commented 1 year ago

Currently, the Qt: Online help seems to work for classes, but not for methods. For example, if I highlight mid in the following code:

QString a;
a.mid(3);

Then select Qt: Online help, I get 404 - Page Not Found because the URL it opens is:

https://doc.qt.io/qt-5/mid.html

Whereas it should be:

https://doc.qt.io/qt-5/qstring.html#mid

I don't know how this Qt plugin works, but it obviously can't work out that URL just by looking at the highlighted text, as that doesn't include QString at all.

However, Intellisense does know exactly which method is being referred to:

image

Is there a way to hook in to Intellisense to get the info needed to create the correct URL?

tonka3000 commented 1 year ago

Hi @srcejon,

you are right, currently it is really just append the selection to the url.

AFAIK I can not access the highlight primitives or the Intellisense Infos from another extension, so I would need to parse it myself.

I've opened a discussion to get a feeling how to impl. that.

I've added https://github.com/tonka3000/vscode-qt-tools/labels/feature for now.

tonka3000 commented 1 year ago

Hi @srcejon,

it seems that there is no way to get the information. I checked vscode.executeDocumentSymbolProvider and cpptools-api but non of them provider the required information.