Format your 4D Code in Visual Studio Code

A new feature of the VS Code extension arrives with 4D V20 R2: code formatting!

In this blog post, we will delve into the details of this new functionality, exploring how it simplifies your programming experience.

When using the VS Code to edit 4D methods or classes, you may have noticed that the code was not formatted like in 4D. Now you can format It the same way 4D does! And the VS Code extension behaves in the same way as other languages.

The first method is to format the entire edited method or class by right-clicking on the code pane and selecting the “Format document” menu item:

The second method consists in formatting a selected part of the code by right-clicking on the code pane and selecting the “Format Selection” menu item:

blank

Code formatting concerns the character case of commands, keywords and constants, as well as indentation, separator spaces, and so on. Note that the indentation unit uses the related VS Code setting.

We constantly strive to provide our users with the best possible experience, and we encourage you to share your thoughts and feedback on the 4D forum. Your feedback helps us better understand your needs and continuously improve our products and services.

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.