개발 Dev/NETCONF, YANG

[YANG] 02. Setting up YANG Development Environment in Visual Studio Code

BoBooBoo 2022. 1. 17. 00:03
반응형

Created: 2022. 01. 16. Sunday.

Subject: #02. Setting up YANG Development Environment in Visual Studio Code

 

※ This article was written for study purposes. So there may be errors or differences depending on when you are reading this article and what environment you are using.

 

After reading this article

1. You will be able to easily write a YANG Data model in Visual Studio Code (VSCode).

2. You can use the auto-completion function, grammear checking, and syntax function for YANG file.

 

 

What You Need (development environment)

- Visual Studio Code (Required)

- Java Development Kit 1.8 (Required)

 

This article is written to use vscode in Ubuntu 18.04 LTS.

 

 

Content

1. Install the VSCode

Since many articles can already be found with a Google search, the VSCode installation process is omitted.

 

 

2. Let's write any example yang file

module my-yang {
    yang-version 1.1;
    namespace "urn:example:my-syng";
    prefix "my";
    
}

 

my-yang.yang example file

 

 3. Install the Extension 'yangster' and 'YANG syntax highlighter'

Install the Extension 'Yangster'

 

Install the Extension 'YANG syntax highligher'

 

 

For now, You can see the highliger of YANG file. But Auto-completion is not working...

 

 

4. Install the JDK8.

sudo apt install -y openjdk-8-jdk

 

 

5. Restart the VSCode.

For now, You can use Grammer Check and Auto-completion (Ctrl+Space).

 

Grammer Check for YANG file

 

Auto-completion for YANG

 

Congratulation!

 

Finally, we are ready to develop the YANG data model.

Next time, let's learn more about YANG.

 

THANK YOU.

반응형