Welcome to my new blog / Introducing my very first Visual Studio Code Extension!
The journey
As you might know, I have been bouncing between different blog platforms for a while now, but I am quite confident that now I have found a platform that will prove stable and consistent, and I will probably be blogging here for a while.
I have always been very keen to learn new things, and constantly trying to make things easier for myself and my co-workers. Some time ago I created a PowerShell script that loops through the folder structure of a Visual Studio Code AL project or workspace, and returns me with a comprehensive list of used ID's from the .al files it finds out.
Picture 1, PS script for getting reserved object numbers
If you are interested in this PS script, I have attached it here as a reference, even though I think you will be much more interested in the evolved version of it: UrpoKo's AL GetReservedObjects VS Code Extension!!!
The background
I started creating the PowerShell script in order to manage the reserved Object Ranges of a largish (to me) Microsoft Business Central AL project I have been working on for quite a some time. The PS script made it easy to find out what objects I had already used, and what objects are available for development.
We actually also use Vjeko's Object Ninja to get Object ID's from inside a project, but sometimes we need to have all used objects and their ID's listed for example when we need to purchase additional objects to a license or present the customer an overlook of the used objects.
The Challenge
After we had been using the PowerShell script for a while, it occurred to me that it would be a lot easier to use if the poor developer didn't need to change tool just to get the object numbers. The obvious solution was crystal clear: it had to be converted to a VSC Extension.
The real challenge here is that I have never earlier been working with JavaScript or TypeScript, so it was a whole new world for me to jump into.
The Resolution
The resolution is now available for downloading from my brand new GitHub repository https://github.com/UrpoKo/ALGetReservedObjects and not only there, it is also available from the Visual Studio Marketplace!
Yes, you read it right, I took the extra effort and registered myself as a Microsoft Developer in VS Marketplace and uploaded my first VSIX file there, and as you are reading this it is available for you to install into your very own Visual Studio Code!
Picture 2, Visual Studio Code marketplace
I have to admit, the visual appearance is quite err... rugged, but I will fine tune it later. The most important thing is that now it is published, and everyone can enjoy the fruits of my very interesting journey with TypeScript!
The Usage
Using the GetReservedObjects extension is quite easy. After installing it, you need to open a Workspace or Project folder, press F1 (or Ctrl-Shift-P), and start typing GetReservedObjects. Clicking or pressing Enter at the command will execute the extension.
Picture 3, Activating extension
After successful run you can see two new files in your currently open folder. The files are named "ReservedObjectsByExtension.txt" and "ReservedObjectsByObjectType.txt".
These files will contain a bit differently sorted list of reserved objects, their number and name, and for Extension objects the extended page, table, report or enum is also shown. For your convenience in the end is also a list of object numbers per type and the number of found .al files.
Picture 4, sample of reserved object text file
*This post is locked for comments