Skip to content
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

Search in documentation #39

Closed
Shatur opened this issue Nov 19, 2020 · 9 comments · Fixed by #40
Closed

Search in documentation #39

Shatur opened this issue Nov 19, 2020 · 9 comments · Fixed by #40
Labels

Comments

@Shatur
Copy link

Shatur commented Nov 19, 2020

In QtCreator, you can press F1 and get help with the current class. Is it possible to add similar functionality to the command palette to open a web page with the selected class? I would suggest providing a search and if it is empty then the class under the cursor will be found.

@tonka3000
Copy link
Owner

Hey,

In theory that sounds possible. The only problem I had in the past is that I'm not quite sure how to use assistant command line args correctly. In need assistant to display the help. Getting the text token under your cursor should be possible, but I never done it in vscode.

I tried -setCurrentFilter but it never worked for me. Also I'm building qt without it's .qch files, so my assistant have only 2 pages of itself in the docs. Do you have some .qch files from your Qt installation you can share?

Args:
image

Greetings

Tonka

@Shatur
Copy link
Author

Shatur commented Nov 19, 2020

I suggested to open web page, but your approach is better :)

Getting the text token under your cursor should be possible, but I never done it in vscode.

I have no experience with extensions, but I know an extension that does exactly this. Perhaps this can be used as a reference.

Do you have some .qch files from your Qt installation you can share?

Sure. Here is some files. Let me know if you need more.
Qt-5.15.0.zip

@tonka3000
Copy link
Owner

Thanks for the files.

I already got the word under the cursor position. Now I just have to find out which args are the correct ones from assistant. Maybe I can also add a setting to use the website instead, but I think you get an messagebox everytime which tells you the url before opening.

@Shatur
Copy link
Author

Shatur commented Nov 19, 2020

but I think you get an messagebox everytime which tells you the url before opening.

No, the extension I mentioned above opens the site directly inside VSCode.

@tonka3000
Copy link
Owner

No, the extension I mentioned above opens the site directly inside VSCode.

Inject via iframe, interesting.

Can you try to call qt assistant from your side with assistant -setCurrentFilter QWidget. On my side this do nothing in the assistant (I expect that the search filter will be filled out). Maybe my assistant is broken.

@Shatur
Copy link
Author

Shatur commented Nov 19, 2020

Can you try to call qt assistant from your side with assistant -setCurrentFilter QWidget. On my side this do nothing in the assistant (I expect that the search filter will be filled out). Maybe my assistant is broken.

No, unfortunately it just opens Assistant quick guide.

@tonka3000
Copy link
Owner

Then I try the Qt website. When it is a class I can just attach it to the url like https://doc.qt.io/qt-5/qwidget.html. I will checkout the webview/iframe approach, but this can take some time.

@Shatur
Copy link
Author

Shatur commented Nov 19, 2020

It would be cool, thanks!

@tonka3000
Copy link
Owner

tonka3000 commented Nov 19, 2020

I pushed a first implementation in the #40 PR (command: Launch Qt help). You can try it out and tell me what is missing. I just attach the word under the cursor to the website, so it mostly works for classes, functions and methods would not work that way. I'm not sure if there is a json based search integrated in the Qt docs website.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants