L-I-V / MQL-Tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto-complete issues

trustfultrading opened this issue · comments

First of all, thank you for the great work. I run a youtube channel in the field of automated trading with MetaTrader. I would like to present your extension, however, I have encountered a few small bugs.

  1. input variables are not suggested.

2023-03-07 10_36_06-● VSCTest mq5 - MQL5 - Visual Studio Code

  1. "sinput" is not recognized as a keyword. ENUM_INIT_RETCODE is not suggested.

2023-03-07 10_39_13-● VSCTest mq5 - MQL5 - Visual Studio Code

  1. classes/structures from include files are not displayed.

2023-03-07 10_42_00-● VSCTest mq5 - MQL5 - Visual Studio Code

  1. if files are mutually included, variables are no longer suggested.

2023-03-07 10_59_23-● VSCTest mq5 - MQL5 - Visual Studio Code

I hope this is helpful. Is there any way to support you with a donation?

commented

Hi trustfultrading, all these bugs will be fixed in the new version of the extension. To solve the issue mentioned in point 4, try applying such a construction in the TestGUI.mqh file.

//###<Experts/Test/VSCTest.mq5>
#ifndef TestGUI_mqh
#define TestGUI_mqh

// your code

#endif

Regarding donations, I will include a link to it in the extension description.

Hi L-I-V, thanks for the quick reply and the update. I think there is still something wrong with point 4.

Works fine for a local object:
2023-03-08 14_59_13-VSCTest mq5 - MQL5 - Visual Studio Code

But not for a global object:
2023-03-08 15_18_49-VSCTest mq5 - MQL5 - Visual Studio Code

In MetaEditor it works even without the preprocessor directives:
2023-03-08 15_28_34-MetaEditor

Thanks again for the great work, if this problem is solved I'll do a tutorial with your VSC Extension ;)

Oh, and is there a way to contact you? You can also contact me via youtube/telegram, I just don't want to write about topics outside of this Extension here on github.

I would like to add something to this issue. When youre trying to access to a function's method, insted of auto completing with object.function() it autocompletes with object->function(). Is this a bug or a problem with my configuration of the extension?

image

commented

Hi trustfultrading.

The issue is that the IntelliSense feature in the 'MQL Tools' extension requires the 'C/C++' extension to be installed. However, due to the fact that the MQL syntax is not fully supported by the 'C/C++' extension, there are problems with the IntelliSense functionality for MQL code.
When adding the file 'VSCTest.mq5' as #include in the file 'TestGUI.mqh', the 'C\C++' extension finds an error 'include file ... includes itself'. That's why I suggested to use preprocessor directive to eliminate this error, because of which auto-completion did not work.

Alternatively, try not to include 'VSCTest.mq5' in 'TestGUI.mqh':
VSCTest

Unfortunately, at this moment I do not have a solution for a complete adaptation of extension "C\C++" for MQL syntax.
You can contact me via email at l.i.v.dpro@gmail.com.

commented

Hi fbravohz. I haven't encountered this problem, so I can't say for sure why it's happening. But since auto-completion is a part of the 'C\C++' extension, I suggest checking its settings.

Hi L-I-V,
thanks for the answer. I'll omit the duplicate include statements, I can live with that. I also deactivated the red underlining and the display of these incorrectly recognized errors in the minimap and explorer:

2023-03-11 14_35_36-VSCTestSignal mqh - MQL5 - Visual Studio Code

2023-03-11 14_29_02-settings json - MQL5 - Visual Studio Code

2023-03-11 14_38_30-VSCTestSignal mqh - MQL5 - Visual Studio Code

I'm really no expert, but maybe this will help someone :)

Thank you for your great work!

commented

According to the screenshots, you have painted over the underlines indicating errors and warnings displayed by the "MQL Tools" extension, for which the data are provided by MetaEditor.
To hide error underlines, disable this option in the settings of the "MQL Tools" extension:
Code_YHSnYg8zjR

Didn't see there was already a setting for this. Thanks again!