microsoft / microsoft/AL

Improve development productivity with Shortcuts for auto-declare a new variable as LOCAL or GLOBAL and add ; al the end

Open
#6,408 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

developer-productivity suggestion
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

I wonder if it would be possible to significantly improve productivity when writing AL code simply by enabling a shortcut like Alt + Enter and a context menu option that allows decide between declaring a new variable as LOCAL or as GLOBAL simply by deducing its Type from its current assignment...

Examples:

myNewIntegerVar := 0;
myNewDateVar := TODAY;
myNewTextVar := anyPreviousLabel;
myNewLabelVar := 'This is a message';
myNewCodeVar := Customer."No.";
myNewSalesLineTempRecordVar := SalesLineTemp; // from a Function parameter, for example
myNewSalesPostVar := salespost.codeunit.al;  // reference to a AL file-name that contains 1 unique object

Also, it should very productive a shortcut like Ctrl + Enter that automatically adds the ; character at the end to a line of code that does not lead previously and position the cursor to the right of the ; character.

NOTE.-
Both are characteristics that other IDES and compilers such as IntelliJ have and that contribute a lot to increase productivity ... since in AL the physical distance between the declaration of LOCAL and GLOBAL variables can be very hight in some files, I consider this essential.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the AL Language extension's VS Code command, context-menu, and editor integration points for AL code. Determine how variable declarations and statement termination are currently handled, then define and test both requested shortcuts, including type deduction, LOCAL or GLOBAL placement, semicolon insertion, and cursor positioning.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.