Configure the AL language extension

Completed

The AL Language extension has several settings that can be specified for a specific user or for a workspace. To activate the settings, press Ctrl+Shift+P, and then select Preferences: Open Settings (UI) for workspace settings or Preferences: Open User Settings for user settings. Under Extensions, and AL Language extension configuration, you will find the settings that are available for the AL Language extension.

A useful setting is Enable Code Analysis, which specifies whether code analysis should be performed for all source files in the current project. Visual Studio Code will give you warnings and errors if your AL code is not compliant with default AL rules. The default value is false. If this value is set to true, you must specify the Code Analyzers setting with the list of code analyzers to use. Code Analyzers sets the list of paths to code analyzers that you can select for performing code analysis.

AL Home

The AL Home view shows news related to developing in AL for Business Central. The AL Home view allows the Business Central research and development department to efficiently share news, best practices, upcoming events, urgent information and status, and learn content.

You can choose when to show the AL Home view as you start up Visual Studio Code, the default is that AL Home is shown when it's updated.

To change the default, go to user or workspace settings, press Ctrl+Shift+P, and then choose Preferences: Open Settings (UI) for workspace settings, or choose Preferences: Open User Settings for user settings. Under Extensions, and AL Language extension configuration, change the Show Home at startup to a different value.

Screenshot of the AL Home page in Business Central.

AL Explorer

The AL Explorer provides a tool that allows you to explore, navigate, and better understand objects in extensions. You can drill down into object details, dependencies, and extension points, without looking at the code. With the AL Explorer, you have an overview of high-level structures of extensions that can help you specify new features, or do light troubleshooting.

Screenshot of the AL Explorer page in Business Central.

The AL Explorer has four tabs:

  • OBJECTS

  • EVENTS

  • APIS

  • EXTENSIBLE ENUMS

For each of these categories, you can apply filtering, bookmarks, and go to source. For tables, pages, and report objects, you can also choose run these objects directly from the explorer window, on either a local machine or a tenant. You can also get an overview of all objects in a given app scope, for example, a workspace or a selected project, and you can search in object names, and group objects by type.

You can select when to show the AL Explorer as you start up Visual Studio Code, the default is that AL Explorer is shown once at startup.

For a selected object, use the Source button to go to source code to develop, read, or understand it, or use it to add breakpoints as part of troubleshooting.

When you choose Source on a given object, the resource exposure policy, which applies to the object, may prevent the entire source code to be shown. In this case, you'll see only fragments of the code.

In the rightmost column, you can bookmark objects used frequently to filter a list of objects to view only the bookmarked ones. For example, when navigating between the objects that you currently work on. Select the asterisk to bookmark an object. Use the Module dropdown to filter only on Bookmarked objects.

The EVENTS, APIS, and EXTENSIBLE ENUMS tabs provide an overview of available extension points and extensible enums that implement interfaces. On any given event, you can choose the Subscribe button, which copies a code snippet with the event subscriber syntax into the clipboard, and you can paste that into a codeunit to get started.