Visual Studio Code - page 3

 
Timur Gatin: Is it possible to disable red squiggles only for MQL functions and constants?

Of course it's possible. Disable your browser's spell checker, or add those symbols to your dictionary.

 
whroeder1:

Of course it's possible. Disable your browser's spell checker, or add those symbols to your dictionary.

I mean C/C++ for Visual Studio Code, Error Squiggles.

 

Timur Gatin:

Is it possible to disable red squiggles only for MQL functions and constants?

So much better, but not perfect, need to complete the string, structures. Compiling works fine, without errors and warnings.

#ifdef __MQLBUILD__
   #property copyright "Copyright 2018, MetaQuotes Software Corp."
   #property link      "https://www.mql5.com"
   #property version   "1.00"
#else
   #include <MQLsyntax.mqh>
#endif

void OnStart()
  {
   Alert("Hallo MQL");
  }

Without it:

Files:
MQLsyntax.mqh  46 kb
 
nicholishen:

I'm pumped - this editor is seriously awesome and the only real hiccup is that the c++ intellisence doesn't recognize the dot operator being used on pointers... oh well. Here is a script that compiles and outputs the results to the terminal inside of VSC using the default Build keybinding of Ctrl+Shift+B.

You'll need to create a workspace.. I created one directly in my MQL folder. Next, go to Tasks > Configure tasks and create a new tasks.json file and paste and edit the paths to your MT install. Note: this isn't ideal...

Here are some bonus keymappings to quick-launch the terminal or the meta-editor


Opening selected source file in metaeditor works too, with:

{
 "label": "launch_metaeditor",
 "type": "shell",
 "command": "YOURPATH\metaeditor64.exe /portable",
 "args": [
    "\"${file}\"",
 ],
},
 
nicholishen:

Pierre,


VS is a full stack IDE and vscode is an open source text editor. The major difference is how they work behind the scenes. Since vscode is an open source text editor it is lightweight out of the box and very fast. It is also very extendable and can go from a plain text editor to pretty much much full blown IDE with the use of extensions. Python is a great example because with the python extensions you can get almost all of the functionality of a full stack IDE without having to wait years for the program to load up. 

So your question was about MQL... Vscode makes it easy to author extensions using JS and JSON, which is exactly what I've begun to do. If you download vscode and install the MQL extension pack and follow the setup instructions, you'll get not only MQL syntax highlighting, but also context aware intellisence (uses microsoft c++ engine) and access to a whole library of MQL snippets (MQL built-in functions with descriptions and auto-complete). 

"If you download vscode and install the MQL extension pack and follow the setup instructions,"  what's the setup instructions?  @nicholishen

 

how to fix  error squiggles ?

 
chenyang313:

how to fix  error squiggles ?

"C_Cpp.errorSquiggles": "Disabled",
And for the tab size you probably also  need to change editor.detectIndentation
// The number of spaces a tab is equal to. This setting is overriden
// based on the file contents when `editor.detectIndentation` is true.
"editor.tabSize": 3,

// Insert spaces when pressing Tab. This setting is overriden
// based on the file contents when `editor.detectIndentation` is true.
"editor.insertSpaces": true,

// When opening a file, `editor.tabSize` and `editor.insertSpaces`
// will be detected based on the file contents. Set to false to keep
// the values you've explicitly set, above.
"editor.detectIndentation": false,
 

Hi

I have VSCode and mql mode and mql snippets.

Since I am new to this editor, how can I get the for loop block to manically get written for me by only typing "for" followed by tab or some other key?

How can I make a keyboard short cut that will type a ";" at the end of line?

...etc

Thanks

 

Hi guys!

This is my contribution to this thread.

I spent several days migrating from Metaeditor to Visual Studio Code and I'm loving it...


https://www.mql5.com/en/blogs/post/719548


How to Code & Compile MQL5 in Visual Studio - A Complete Guide
How to Code & Compile MQL5 in Visual Studio - A Complete Guide
  • www.mql5.com
Well, we are talking here about the Open Source project from Microsoft called Visual Studio Code. It is completely FREE for personal and commercial use. Download it from here: code.visualstudio.com. Install it - the process is plain simple and common. Then, launch it. VSC will automatically launch a web page with initial tutorials, it is a good...
 

While VS is one of the few at least partially good things MS has done over the years you can have dark colors in MetaEditor as well. Background and highlights can be defined in settings and the interface abides Windows themes, although not as perfectly as possible.