L-I-V / MQL-Tools

42 stars 15 forks source link

Code pop-up window won't display #44

Open kabopaca opened 8 months ago

kabopaca commented 8 months ago

Environment Microsoft Windows 11 Home 10.0.22621 Build 22621 Visual Studio Code (VSC) 1.83.1 Metaeditor 5.00 build 2043 (21 Mar 2023) MT4/MQL4

Extensions MQL Tools v2.0.2 compilemql4 v0.0.1 (with the proper parameters to my project) C/C++ IntelliSense, debugging, and code browsing. v1.17.5 (VSC asked to install this due to dependencies with MQL Tools)

Problem The first time, I installed the above extensions to VSC. Everything worked well. VSC could recognize my MQL4 code. If I type IMA, for instance, a pop-up window would open, and suggestions would display the entire iMA function within the pop window, which is useful and handy. I do not know what happened, and it stopped working. My MQL code is no longer recognized. I have entered all parameters (Include4 Dir, Metaeditor4 Dir) correctly as done the first time. The 3 buttons (Checking the syntax of mqh/mq4/mq5 files (without compilation, Compilation of mq4/mq5 files, Compilation of mq4/mq5 files using script) seem to work just fine. VSC launches Metaeditor to compile. However, I do not have this suggestion/pop-up to work.

There seems to be an issue with Mql_tools: Intelli Sense Mode. I changed the mode, restarted, reinstalled VSC, delete settings.json, etc, I still do not get the pop-up to display and have the VSC recognize my MQL4 customs and built-in functions.

I have tried to resolve this issue for 2 days; and at this point, it seems more appropriate to create this issue.

Please advise.

ZaneH commented 6 months ago

I'm experiencing this with macOS as well. The IntelliSense works for a brief second before completely going away. Tagging @L-I-V because this is a relatively old issue. It seems to only affect imported code (for example, the iMACD IntelliSense always works as expected, but CTrade doesn't.)

Working IntelliSense

SCR-20231216-cqke

About half a second later, it disappears completely

SCR-20231216-cqqm


Here is my settings.json ```json { "C_Cpp.default.forcedInclude": [ "/Users/zane/.vscode/extensions/l-i-v.mql-tools-2.0.2/data/mql5_en.mqh" ], "C_Cpp.default.includePath": [ "${workspaceFolder}/**", "${workspaceFolder}/Include" ], "C_Cpp.default.compilerPath": "", "C_Cpp.default.intelliSenseMode": "macos-clang-arm64", "C_Cpp.errorSquiggles": "disabled", "C_Cpp.autocompleteAddParentheses": true, "mql_tools.context": true, "files.exclude": { "**/*.ex4": true, "**/*.ex5": true }, "files.associations": { "*.mqh": "cpp", "*.mq4": "cpp", "*.mq5": "cpp" } } ```

The only error message I see is in the "Extension Host" output panel (suspected culprit):

2023-12-16 02:07:53.240 [error] TypeError: Cannot read properties of undefined (reading 'uri')
    at f.value (/Users/zane/.vscode/extensions/l-i-v.mql-tools-2.0.2/out/extension.js:1:32878)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.z (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1972)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2188)
    at f.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:145:16612)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at i.acceptDocumentsAndEditorsDelta (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:12599)
    at i.$acceptDocumentsAndEditorsDelta (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:10970)
    at l.S (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:10829)
    at l.Q (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:10595)
    at l.M (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:9685)
    at l.L (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:8764)
    at f.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:150:7567)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:14039)
    at f.value (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:7903)
    at n.y (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
    at n.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
    at o.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:103:14039)
    at MessagePortMain.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:171:6183)
    at MessagePortMain.emit (node:events:513:28)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367)
2023-12-16 02:07:56.750 [info] Extension host terminating: renderer closed the MessagePort
2023-12-16 02:07:56.806 [info] Extension host with pid 33445 exiting with code 0

edit: Also including a picture of my VSCode workspace.

image

I've also tried:

ZaneH commented 6 months ago

I'm experiencing this with macOS as well. The IntelliSense works for a brief second before completely going away. Tagging @L-I-V because this is a relatively old issue. It seems to only affect imported code (for example, the iMACD IntelliSense always works as expected, but CTrade doesn't.)

Just stumbled on the solution while practicing.

My include at the top was using a backslash:

#include <Trade\Trade.mqh> // this is valid, but the extension doesn't like it

After changing it to a forward slash, MQL Tools properly resolves the type and all is well with my IntelliSense.

image