Visual Studio Code - page 6

 
james272:

i want to move Description intellisense popup window to the left most side.

how is it possible ?

anyone please help me? 

Do not double post!!

I have deleted your duplicated topic.

 

Hi, did anyone know where to find the function-definitions for cpp/mql-language?? I've set up VSC for MQL4 and it works fine but only one issue i want to fix:

If i #include a file containing #import for some functions out of a .mq4-library, then at the library you have to mark a function to allow that:


void SomeFunction(int iParam) export

{

// DoSomeWork

}


The keyword "export" now makes the function cannot be found as a valid function. My fix for NPP was a modified Regex-String to allow the keyword "export" between the brakets and the body:

mainExpr="^(void|char|uchar|short|ushort|int|uint|long|ulong|enum|float|double|string|bool|datetime|color){1}[\t ]+[\w]+[\t ]*\([^\)\(]*\)[\t ]*(export)?[\n\s]*\{?"

an that worked for NPP. Where can I find that definition for CPP/MQL4 at VSC ??


Thank you..

Michael

 
gilianp:
Hi, I not able to get auto-complete for built-in MQL functions/structs like SymbolInfoTick() or MqlTick for example. With this method I can have that?
Hey, I have the same issue. Have you found any solution for this issue?
Cheers
 

I see that there are other people with the same problem here.

I post also here the message I have created in the main thread, in the hope that some mighty coder would have a look:

After following ALL the instructions of the other thread, and after having used VSC for mq5 for quite a long, perhaps for one of the last updates of the C/C++ extension, I cannot get IntelliSense work anymore when editing mql5 code. I checked and re-checked the settings.json and config.json files and they are perfectly right. Uninstalled and re-installed all the extensions... VSC is still able to even find references to definitions and compile mql5, but... no intellisense anymore. Even... the "native" VSC functionality when uninstalling all the extensions is better: at least it "recognizes" for instance names of methods just by looking at "keywords in the text". Something that QUITS WORKING when installing the extensions...

Since coding without Intellinsense is like using MS Word for writing code... I am pretty desperate.

How to Code & Compile MQL5 in Visual Studio - A Complete Guide
How to Code & Compile MQL5 in Visual Studio - A Complete Guide
  • 2021.01.22
  • www.mql5.com
After reviewing a couple of alternative IDEs/Source Code Editors that could be used to code and compile in MQL5 instead of using the original Metaeditor IDE, I decided to go with Visual Studio Code
 


I installed the MQL5 syntax highlighter extension for VS code and I'm getting this intellisense errors did someone have the same problem? Anyone have a solution?

 

Hey guys,

I was having a problem where my variables from include paths were not coming in autocomplete list.

I followed the guide here:

https://stackoverflow.com/questions/57458423/vscode-not-recognizing-includes-from-includepath

Installed mingw gcc from:

https://www.mingw-w64.org/downloads/

This one:

Changed my c_cpp_properties.json file properties:

"compilerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-win32-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe",
"intelliSenseMode": "gcc-x64",

And now auto-complete is working fine for everything :)

My earlier "intelliSenseMode": "windows-msvc-x64",

was causing this problem. Not sure what the exact issue is. But gcc works great :)

Hope it helps others facing similar issue.


Also people facing compilation problems could use the extension compilemql4 in vscode.

I have created a keyboard shortcut for it and it works great. Only problem is that I have to Refresh the Indicators List in MT4 for it to take effect.

Please let me know if someone has found an automatic workaround for this. Thanks :)

 
Abir Pathak #:

Hey guys,

I was having a problem where my variables from include paths were not coming in autocomplete list.

I followed the guide here:

https://stackoverflow.com/questions/57458423/vscode-not-recognizing-includes-from-includepath

Installed mingw gcc from:

https://www.mingw-w64.org/downloads/

This one:

Changed my c_cpp_properties.json file properties:

And now auto-complete is working fine for everything :)

My earlier "intelliSenseMode": "windows-msvc-x64",

was causing this problem. Not sure what the exact issue is. But gcc works great :)

Hope it helps others facing similar issue.


Also people facing compilation problems could use the extension compilemql4 in vscode.

I have created a keyboard shortcut for it and it works great. Only problem is that I have to Refresh the Indicators List in MT4 for it to take effect.

Please let me know if someone has found an automatic workaround for this. Thanks :)

Thanks it good works, but all string vars and some mql functions still are not visible. Mb you fixed this problem too?


 
Ruslan Piraliyev #:

Thanks it good works, but all string vars and some mql functions still are not visible. Mb you fixed this problem too?


Yes, 

I was facing the same issue. Problem is with "C/C++ for Visual Studio Code" extension itself.

Disabling it makes strings auto complete work just fine.

Unfortunately MQL Extension Pack needs it. So, I keep it enabled.

Might be some other setting I'm missing. Like instead of gcc.. maybe some other compiler might work. Not sure...

Also, was facing issue with autocomplete from variables of include files.

I'll let you know if I ever figure it out :)

 
nicholish en #:

I just published a new MQL syntax highlight extension that runs on top of cpp so you can use all cpp extensions (Intellisence, clang-format, etc.) with MQL and keep the MQL syntax. In order to make this work you need to map MQL file extensions to cpp in the user settings:


Extension available in the VS marketplace

https://marketplace.visualstudio.com/items?itemName=nicholishen.mql-over-cpp

Great work, nicholishen, thanks a lot!

However, as of 2022, formatting MQL5 code in VS Code seems to be at least partially broken!?

The issue is with MQL5's datetime format, e.g.: 

D'2022.08.02 08:20:35'

After installing VS Code afresh, then installing your VS Code-Extension Pack as described, mapping MQL to C++ in settings.json as described and then formatting MQL5 in VS Code (via Shift + Alt + F), the above datetime gets reformatted to:

D '2022.08.02 08:20:35'

(please note the inserted space between D and '2022.08.02 08:20:35')

This results in a compilation error!

Do you know any workaround to this or will you kindly update your otherwise still great VS Code extension, please?

 
v3nen0 #:


I installed the MQL5 syntax highlighter extension for VS code and I'm getting this intellisense errors did someone have the same problem? Anyone have a solution?I'm 

I'm struggling with the same problem. 

Have you fixed this?

Reason: