L-I-V / MQL-Tools

42 stars 15 forks source link

F1 Help not working #2

Closed mishaxz closed 1 year ago

mishaxz commented 1 year ago

Hi, great stuff here..

I have everything working except that F1 doesn't open the help (currently I'm trying in MQL4 but I think for 5 it also doesn't)

Any ideas what I should configure for this?

Compiling works fine.

L-I-V commented 1 year ago

Maybe you have F1 used by another extension. Go to the 'keyboard shortcut' by pressing Ctrl+k Ctrl+s and check where F1 is used. There you can also assign another keyboard shortcut to open the help.

mishaxz commented 1 year ago

Keyboard shortcuts show

{
  "key": "f1",
  "command": "mql_tools.help",
  "when": "config.mql_tools.Help.HelpON && resourceExtname == '.mq4' || config.mql_tools.Help.HelpON && resourceExtname == '.mq5' || config.mql_tools.Help.HelpON && resourceExtname == '.mqh'"
}
L-I-V commented 1 year ago

No need to edit extension files!

keyboard shortcuts

mishaxz commented 1 year ago

thanks, yes I wasn't editing it just pasting what I had.

My F1 keys are assigned just like in your screenshot

and I don't see any other extensions with F1 listed there

L-I-V commented 1 year ago

This option must be enabled in the extension settings

HelpOn

What happens after you press F1? Do error messages appear?

mishaxz commented 1 year ago

yes it was enabled but I just unchecked it and rechecked it just to be sure. Also everything is configured for path of metatrader and I can compile fine.

pressing F1 does nothing. I tried to both have the caret in the middle of the word as well as selecting the word and pressing F!. Both times nothing happens.

I tried it on StringFormat(), StringSubStr(), EventSetMillisecondTimer(), OnInit() and others

L-I-V commented 1 year ago

Try without F1. Select the text, press Ctrl+Shift+P to open the Command palette and select MQL: Get MQL4/MQL5 Help.

mishaxz commented 1 year ago

wow that worked. This is going to make me a more efficient coder.

Any idea what I need to do to fix F1? or should i assign it to another key

L-I-V commented 1 year ago

Open 'keybindings.json' F1 and if there is f1, delete and save the file and try calling help via F1. If it doesn't help then assign another key, e.g. Shift+F1

kaloworx commented 1 year ago

Hi L-I-V, after the latest update which has fixed Syntax checking for portable MT4, the F1 for Help does not work any more. I did a clean install of VSCODE as well as MT4.

The steps I follow is like this: 1- Clean install VSCODE (portable version with own data folder as per these instructions: https://code.visualstudio.com/docs/editor/portable) 2 - Clean install of MT4 (portable version) 3 - Install your MQL-Tools extension for VSCODE 4 - Set the Metaeditor path and check the portable checkbox 5 - Open any MQL4 or MQH file and check that Syntax checking and compilation work (all works 100%) 6 - Select a MQL language keyword and press F1 6.1 - A short message pops up bottom right hand corner indicating Help file is loading....thereafter nothing ever again....

Tried restarting - no go.

I can see that a files\help folder is created under your extension folder and that the mql4.chm file is coppied over to it, but the help system is currently not working at all....

Even if I try to run it from the Ctrl+Shift+P menu by selecting the word in the code and then MQL: Get MQL4/MQL5 Help from the command pallete, it also does not open the help file....

It's like the extension knows where to put the file during install, but can't find it afterwards - some path finder bug perhaps...

kaloworx commented 1 year ago

Hi L-I-V,

In regards to my report above, I have done some "investigation" (aka newbie hacking) by adding a few outputs in you "help.js" file just so I can see if the path was received correctly and try and find up until where things worked as expected....and I have found the issue, I think :)

When there is a space in the path name, even if the path is correctly received from __define and concatenated, the help file is not accessed.... C:\VS Code...... will not work with that space between VS and Code C:\VSCode..... works 100%

When I remove the space from the path, all works 100% - I honestly do NOT mind removing a space from my file name structure so I would not worry about this any further unless you know of a quick code fix for this to compensate for spaces in the path name.... strangely though with the really installed (non-portable) version of VS Code, there are spaces in the path...

image

image

L-I-V commented 1 year ago

Hi kalotech. I am grateful to you for the investigation carried out to identify the cause of the error. You've saved me a lot of time. An update with fixes is already on the Marketplace.

kaloworx commented 1 year ago

Once more, thank you so much for your time and generosity! Stay awesome!