VS Code Extension: Code Completion

A new release, a new VS Code extension feature.

4D v19 R8 brings a new capability to the Visual Studio Code editor through the 4D-Analyzer extension: Say hello to code completion.

Starting with 4D v19R8, when you type code in a 4DM file, the contextual suggestions appear in a popup menu. You can go up and down in the list; the signature help of the highlighted item is displayed next.
And you can automatically validate the choice by typing the TAB keystroke or clicking on the desired item in the menu.
Code completion is available for:

    • 4D commands
    • object attributes
    • object functions
    • methods
    • variables
    • constants
    • types

 

The example below displays the VS Code screen when typing “This.t” in an entity class function.

 
The suggestions appear when you type several characters. But if you haven’t typed some characters yet, you can press the CTRL+SPACE keystrokes to display all contextual elements available.
In the example below, we typed the “File“ command and pressed the CTRL+SPACE keystroke to display all related constants.
blank

Completion is also available for keywords! When you type an opening keyword such as If or Use, the corresponding ending keyword is proposed on the following lines.blank

Happy coding! And as usual, feel free to comment on the 4D Forums.

Avatar
• Product Owner •Damien Fuzeau has joined the 4D Product team in February 2019. As a Product Owner, he is in charge of writing user stories, then translating them to functional specifications. His job also entails making sure that the feature implementations delivered are meeting the customer needs.Damien is graduated from the University of Nantes in software engineering. He spent more than 23 years in its former company, first as developer (discovering 4D in 1997), and later as engineering manager and software architect. This company is a 4D OEM partner and deployed 4D based business softwares for thousands users, on hundreds servers. So, Damien is used to 4D development and deployment in a multi-language context.