Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word highlight extension have to be case insensitive #1

Closed
KozlovPavel677 opened this issue May 15, 2019 · 4 comments
Closed

Word highlight extension have to be case insensitive #1

KozlovPavel677 opened this issue May 15, 2019 · 4 comments
Labels

Comments

@KozlovPavel677
Copy link

Hi.
Word highlight extension have to be case insensitive because X++ is (unlike C++) case insensitive language.

So, such code is valid in X++ :
InventTable InventTable;
;
...
inventTable = iNventtAble::find(...);
...

But extension don't show all 'inventtable' string in source code and it makes this Extension useless.
It is very important for use with legacy dirty code.

Please, fix it.

Probably, it can be fixed here
https://github.com/jaestevan/AX2012-Editor-Extensions/blob/master/JAEE.AX.EditorExtensions/JAEEHighlightWordExtension/HighlightWordTagger.cs

line 135

// findData.FindOptions = FindOptions.WholeWord | FindOptions.MatchCase;
findData.FindOptions = FindOptions.WholeWord;
@bhakterija
Copy link

Hi Pavel,
IMHO, having it case sensitive makes more sense as it distinguishes types from variables. If you're dealing with dirty code, which sounds more like an edge case, do simple search-and-replace first.

@KozlovPavel677
Copy link
Author

I tried implement this modification for my own use

// findData.FindOptions = FindOptions.WholeWord | FindOptions.MatchCase;
findData.FindOptions = FindOptions.WholeWord;

but it does not work as expected :(
Nothing changed. Highlight stays case sensitive.
Can anybody help ?

@MichalKopaczewski
Copy link

It works for me with Dynamics Ax 2012 R3 CU9. In your example i have all inventtable words highligted. Are you sure you compiled everything without erros and copied right files to right location? I used batch file provided in output folder with admin rights.

@jaestevan
Copy link
Owner

Hi Pavel,

As mentioned already, making it case sensitive is by design so we can differentiate variable names from types (like: CustTable custTable;), which is an X++ Best Practice.

You can of course recompile it with any change you find useful as per your preference, all code is available, and the change you suggested should work; but probably fixing code case will be quicker and recommended anyway especially if you are planning to migrate such code to Finance and Operations.

Regards and thanks so much for the interest.

JA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants