|
![]() |
#1 |
Участник
|
waldo: New Command in My CRS AL Language Extension: Search Object Names
Источник: https://dynamicsuser.net/nav/b/waldo...h-object-names
============== Recently, I came across this post by Jack Mallender. An interesting idea on how to efficiently find AL Objects among your files. It basically comes down to using regex in combination with the global search functionality in VSCode, like (yep, I’m stealing this from Jack’s post – sorry, Jack ;-)): ![]() So – I present to you – a new command as part of the extension: Search Object Names. Simply call the command, provide the searchstring, and look at the result in the search window: ![]() ![]() May be it’s a bit overdone, but yes, there is a setting as well (CRS.SearchObjectNamesRegexPattern) , because you might want to search differently than I do .. . We were discussing that on twitter, and I just decided to not decide for you on how you want to search, but let you set it up if you would like to search differently as me. Let me give you a few options on what would be interesting settings… Find the source object (default) Pattern: '^\w+ (\d* )?"*'Setting in VSCode: "CRS.SearchObjectNamesRegexPattern": "^\\w+ (\\d* )?\"*"// Mind the escape charactersThis is the default pattern, which means you don’t have to set anything up for this behaviour. Basically this pattern will search any occasion where it starts with a word, than optionally a number, and then your search string.. . In other words: the exact source object of the object name you’re searching for.. . Find all references Pattern: '\w+ (\d* )?"*'Setting in VSCode: "CRS.SearchObjectNamesRegexPattern": "\\w+ (\\d* )?\"*"// I just removed the "^" from the default setting, which indicates "search anywhere"This pattern willsearch any occasion in code – which means: also the variable declarations. Let’s say it’s an alternative “whereused”. I won’t set it up like thisas a default setting, but I might just change it ad hoc in the search by simplyremoving that character.. . Find anywhere in the name Pattern: '^\w+ (\d* )?"*(\w+ *)*'Setting in VSCode: "CRS.SearchObjectNamesRegexPattern": "^\\w+ (\\d* )?\"*(\\w+ *)*"// basically added that there could be multiple words before the searchstring.This pattern issomewhat more complicated, but if you would not rely on your search term beingthe beginning of the object, but rather “somewhere” in the objectname, you could use this one. Enjoy! Источник: https://dynamicsuser.net/nav/b/waldo...h-object-names
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|