AL Navigator – Visual Studio Code Extension

AL Navigator – Visual Studio Code Extension

Features

My AL Navigator extension for Visual Studio Code enables you to automatically create variables in AL and navigate through .al files with awesome shortcuts.

AL Navigator – Create Variables

AL Navigator provides a CodeAction for the AL compiler error 118 “The name does not exist in the current context“. This CodeAction enables you to automatically create a local or global variable by using the names of standard objects as well as names of your local workspace files. The extension will automatically detect the object type and name and create a variable for it. If no object type and name can be found however, the variable will be created without a type. In other words, it is smart!

Use the Quick Fix lamp (Ctrl + .) to automatically add variables.

Finally, here you can see an example:

AL Navigator – Shortcuts

I love to use shortcuts. Whenever possible, I would prefer them over the mouse. Thus, this extension comes with a few very useful shortcuts, from which the most useful ones in my opinion are these:

  • AL Navigator: Next DataItem: Jumps to the next data item in your report .al file
  • AL Navigator: Last local var line: Jumps to the last line of your local var section (a nice addition to the AL Variable Helper by Rasmus Aaen)
  • AL Navigator: Last global var line: Jumps to the last line of your global var section (a nice addition to the AL Variable Helper as well)

Here is an overview of the complete shortcut list:

  • Ctrl + o + m: jump to the OnModifyTrigger
  • Ctrl + o + i: jump to the OnInsertTrigger
  • Ctrl + o + d: jump to the OnDeleteTrigger
  • Ctrl + Alt + l: jump to last line of local var section (fast way to declare new variables)
  • Ctrl + Alt + g: jump to the last line of global var section (fast way to declare new variables)
  • Ctrl + Alt + k: jump to the keys section in your .al file
  • Ctrl + Alt + a: jump to next action in a page .al file
  • Ctrl + Alt + t: jump through all triggers in your .al file
  • Ctrl + Alt + d: jump through data items in your .al report file
  • Ctrl + Alt + j: jump through OnAfterGetRecord triggers in your .al file

AL Navigator – Create Procedure Stub

A few months ago, I added a feature to automatically create procedure stubs. You can read more information about it here. Last week I removed this feature, after it was better implemented in the extension AL CodeActions.

AL Navigator – Download

You can download the extension from Visual Studio Marketplace or via Visual Studio Code. If you are interested in the source code, you can find the github project here.

Have a nice week!

6 thoughts on “AL Navigator – Visual Studio Code Extension

  1. Thank you very much.
    Was about time somebody created something like this :).
    Do you care to share the source code or make it available as a public repository on Github ?

    1. Hey Simon,
      thank you for your comment. This extension is still a work in progress, I’m almost daily adding new things, so by the end of next week I will probably write a new post with its new capabilities.
      There is a link to the github repo at the end of the post πŸ™‚ AL Navigator repo

      1. A new thing I would like to see is when you write .SetCurrentKey, a similar ‘list’ (=like option to create variable as local / global) pops up when you press CTRL + ; with all the available keys for the table.
        Do you see this possible? Or are you technically limited?

        1. Wow, that sounds like a good idea πŸ™‚
          Should be possible by listening to the diagnostics code 135:
          “There is no argument given that corresponds to the required formal parameter ‘Field1’ of ‘SetCurrentKey(Joker, [Joker])'”

          I will add this to my enhancement todos. I guess I can do that within a month, the enhancement todo list is already big πŸ™‚

Leave a Reply

%d bloggers like this: