<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shan Mahanama</title>
    <description>The latest articles on DEV Community by Shan Mahanama (@shan1024).</description>
    <link>https://dev.to/shan1024</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F33993%2Ff87bb66a-936d-4659-b34f-4ff18b0ad6e5.jpg</url>
      <title>DEV Community: Shan Mahanama</title>
      <link>https://dev.to/shan1024</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shan1024"/>
    <language>en</language>
    <item>
      <title>Setting up Ballerina in IntelliJ IDEA</title>
      <dc:creator>Shan Mahanama</dc:creator>
      <pubDate>Tue, 14 Nov 2017 17:14:33 +0000</pubDate>
      <link>https://dev.to/shan1024/setting-up-ballerina-in-intellij-idea-dap</link>
      <guid>https://dev.to/shan1024/setting-up-ballerina-in-intellij-idea-dap</guid>
      <description>&lt;p&gt;&lt;a href="https://ballerinalang.org/" rel="noopener noreferrer"&gt;Ballerina&lt;/a&gt; is a new open source programming language with textual and graphical syntaxes. From this article, I am focusing on providing a step by step guide for setting up a Ballerina project in &lt;a href="https://www.jetbrains.com/idea/" rel="noopener noreferrer"&gt;IntelliJ IDEA&lt;/a&gt;. If you want to learn more about Ballerina Language, you can refer &lt;a href="https://medium.com/ballerinalang/ballerina-making-sequence-diagrams-work-d0d7b3846a80" rel="noopener noreferrer"&gt;this&lt;/a&gt; article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Ballerina plugin
&lt;/h2&gt;

&lt;p&gt;So the first thing we need to do is installing Ballerina plugin to IntelliJ IDEA. But please note that you must have IDEA version 2016.3 or above to use the plugin. This plugin supports both IDEA Community and Ultimate versions.&lt;/p&gt;

&lt;p&gt;Steps to install Ballerina plugin -&lt;br&gt;
1) Go to &lt;strong&gt;File&lt;/strong&gt; (&lt;strong&gt;Preferences&lt;/strong&gt; in &lt;strong&gt;MacOS&lt;/strong&gt;) -&amp;gt; &lt;strong&gt;Settings&lt;/strong&gt;.&lt;br&gt;
2) Select &lt;strong&gt;Plugins&lt;/strong&gt; section and click on &lt;strong&gt;Browse repositories&lt;/strong&gt; button.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Faab69ypxtakk9d4z330c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Faab69ypxtakk9d4z330c.png" alt="Settings"&gt;&lt;/a&gt;&lt;br&gt;
3) Type “ballerina” in the search box. Ballerina plugin will be shown as below. Click on the Install button.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fac3w2pand2tl8yjcl7oq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fac3w2pand2tl8yjcl7oq.png" alt="Browse Repositories"&gt;&lt;/a&gt;&lt;br&gt;
4) After installing the plugin successfully, you need to restart the IDEA.&lt;/p&gt;

&lt;h2&gt;
  
  
  Downloading Ballerina runtime
&lt;/h2&gt;

&lt;p&gt;To use Ballerina plugin to it’s full potential, you need to add the Ballerina Runtime as a SDK to the IDEA.&lt;br&gt;
You can download the runtime distribution from the &lt;a href="https://ballerinalang.org/downloads/" rel="noopener noreferrer"&gt;BallerinaLang&lt;/a&gt; website. Download the runtime distribution and unzip the file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a new Ballerina project
&lt;/h2&gt;

&lt;p&gt;1) Go to &lt;strong&gt;File&lt;/strong&gt; -&amp;gt; &lt;strong&gt;New&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Project&lt;/strong&gt;.&lt;br&gt;
2) Select &lt;strong&gt;Ballerina&lt;/strong&gt; project type and select &lt;strong&gt;Next&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa74ketkjokqb37poxjkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa74ketkjokqb37poxjkw.png" alt="Project Wizard"&gt;&lt;/a&gt;&lt;br&gt;
3) Now we have to setup a Ballerina SDK in the next window. Click on &lt;strong&gt;Configure&lt;/strong&gt; button.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqn7wwjatdxjqrt3wr8im.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqn7wwjatdxjqrt3wr8im.png" alt="Project Wizard"&gt;&lt;/a&gt;&lt;br&gt;
4) Then select the unzipped runtime directory and select &lt;strong&gt;OK&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Flby5snrgwbwitzeabjxz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Flby5snrgwbwitzeabjxz.png" alt="SDK Home selection"&gt;&lt;/a&gt;&lt;br&gt;
5) If you followed the steps correctly, the Ballerina runtime should be added as a SDK successfully. Now select &lt;strong&gt;Next&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fsuzmb1olewx1izvv8e4b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fsuzmb1olewx1izvv8e4b.png" alt="Project Wizard"&gt;&lt;/a&gt;&lt;br&gt;
6) Now update the Project name and Project location and select &lt;strong&gt;Finish&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc9ftfvxchh99wc0r6k6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc9ftfvxchh99wc0r6k6z.png" alt="Project Wizard"&gt;&lt;/a&gt;&lt;br&gt;
7) Ballerina project will be created and opened like shown below.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5oat0o3mwgtj8mxi5l3v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5oat0o3mwgtj8mxi5l3v.png" alt="Ballerina Project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a new Ballerina file
&lt;/h2&gt;

&lt;p&gt;1) Go to &lt;strong&gt;File&lt;/strong&gt; -&amp;gt; &lt;strong&gt;New&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Ballerina File&lt;/strong&gt;.&lt;br&gt;
2) Enter a file name and select the &lt;strong&gt;Ballerina Main&lt;/strong&gt; kind. Ballerina Main kind will create a new file with a main function. There are few other kinds as well.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fthsk87wlpw5frfh4rs5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fthsk87wlpw5frfh4rs5p.png" alt="New File"&gt;&lt;/a&gt;&lt;br&gt;
3) Now you will have a new Ballerina program file with a main function.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1aqbti7xziyuifm4fziz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1aqbti7xziyuifm4fziz.png" alt="New File"&gt;&lt;/a&gt;&lt;br&gt;
4) Now you can use the run icon next to the main function to run the program. If you don’t add a Ballerina SDK, you wont be able to run Ballerina programs in the IDEA. That is why we configured a Ballerina SDK in the previous section.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1gkyrafipg652h8n7epl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1gkyrafipg652h8n7epl.png" alt="Run File"&gt;&lt;/a&gt;&lt;br&gt;
Click on the run icon and select the run command.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F04dn9pd27636wtzsjrik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F04dn9pd27636wtzsjrik.png" alt="Run File"&gt;&lt;/a&gt;&lt;br&gt;
5) You will see the output in the Run window.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcdru60n1yx41fwgp9dig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcdru60n1yx41fwgp9dig.png" alt="Run Window"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations, you have successfully configured Ballerina in IntelliJ IDEA and executed the Hello World program. Now you are ready for some serious action in Ballerina :)&lt;/p&gt;

&lt;h2&gt;
  
  
  So where to next?
&lt;/h2&gt;

&lt;p&gt;You can refer &lt;a href="https://ballerinalang.org/docs/by-example/" rel="noopener noreferrer"&gt;Ballerina by Example&lt;/a&gt; to see various examples written in Ballerina. Also if you have questions, suggestions, etc, you can -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send them to &lt;a href="https://groups.google.com/forum/#!forum/ballerina-dev" rel="noopener noreferrer"&gt;Ballerina dev&lt;/a&gt; Google group.&lt;/li&gt;
&lt;li&gt;Send them to &lt;a href="https://ballerinalang.slack.com/messages/C47EAELR1/" rel="noopener noreferrer"&gt;Ballerina Slack&lt;/a&gt; channel.&lt;/li&gt;
&lt;li&gt;Open a &lt;a href="https://github.com/ballerinalang/ballerina/issues" rel="noopener noreferrer"&gt;GitHub issue&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ballerina</category>
      <category>ballerinalang</category>
      <category>intellijidea</category>
    </item>
    <item>
      <title>How I added Ballerina support to GitHub</title>
      <dc:creator>Shan Mahanama</dc:creator>
      <pubDate>Mon, 23 Oct 2017 17:15:38 +0000</pubDate>
      <link>https://dev.to/shan1024/how-i-added-ballerina-support-to-github-6g</link>
      <guid>https://dev.to/shan1024/how-i-added-ballerina-support-to-github-6g</guid>
      <description>&lt;p&gt;The story begins when I joined the &lt;a href="https://ballerinalang.org/"&gt;Ballerina&lt;/a&gt; team at &lt;a href="http://wso2.com/"&gt;WSO2&lt;/a&gt; few months ago. I was working on the Ballerina IntelliJ IDEA plugin one day and suddenly I had an idea. That idea was, “What if we can add Ballerina syntax highlighting support to GitHub as well !?”.&lt;/p&gt;

&lt;p&gt;As all of you know, GitHub provides syntax highlighting support for hundreds of languages like Java, JavaScripts, GO, etc. When we send a PR, we see the nicely highlighted diff. Also you can see the programming languages used in a repository by clicking on the language detail bar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--86bRsXa4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/n36md73wb75odvvpkoid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--86bRsXa4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/n36md73wb75odvvpkoid.png" alt="Language Details in GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But have you ever thought about how that syntax highlighting is done in GitHub? Nope, right? Neither did I. It just works and we took that for granted and never even bothered to think about it twice.&lt;/p&gt;

&lt;p&gt;So once I had this thought, I googled about how the syntax highlighting is done in GitHub. I found out that this capability is provided by the &lt;a href="https://github.com/github/linguist"&gt;Linguist&lt;/a&gt; library.&lt;/p&gt;

&lt;p&gt;I checked the repository to see whether there is any guidelines for adding a new language to it. Fortunately, &lt;a href="https://github.com/github/linguist/blob/master/CONTRIBUTING.md"&gt;CONTRIBUTING.md&lt;/a&gt; contained a section on &lt;em&gt;Adding a language&lt;/em&gt;. It looked like &lt;a href="https://www.ruby-lang.org/en/"&gt;Ruby&lt;/a&gt; is needed for the process. Also I saw this.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We try only to add new extensions once they have some usage on GitHub. In most cases we prefer that extensions be in use in hundreds of repositories before supporting them in Linguist.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At that time, Ballerina was still on its early stages and did not had much usage in GitHub. Also we were very busy at that time with back to back releases, so I wanted to check it when I have some free time and we have more usage in GitHub.&lt;/p&gt;

&lt;p&gt;Few months passed by and finally I found some time to work on this again. By that time, more and more Ballerina files were added to GitHub as well. So I decided to pick from where I left. Surprisingly, adding a language to GitHub was easier than I thought even though there were few hiccups along the way.&lt;/p&gt;

&lt;p&gt;In the below sections, I will summarize the steps I used to add Ballerina language to the Linguist library.&lt;/p&gt;

&lt;h3&gt;
  
  
  Grammar File
&lt;/h3&gt;

&lt;p&gt;First of all, you need a grammar file which defines the rules which will be used for syntax highlighting.&lt;/p&gt;

&lt;p&gt;There are various ways to define a grammar, but we need the grammar as a tmLanguage file (&lt;a href="https://manual.macromates.com/en/language_grammars"&gt;textmate grammer&lt;/a&gt;) since it is the grammar linguist library supports. Fortunately for me, this was already created for Ballerina VS Code plugin. You can find the grammar file I used &lt;a href="https://github.com/ballerinalang/plugin-vscode/blob/master/syntaxes/ballerina.tmLanguage"&gt;here&lt;/a&gt;. This grammar was bit older, but it was enough to get things started. Grammar file also should have one of &lt;a href="https://github.com/github/linguist/blob/257425141d4e2a5232786bf0b13c901ada075f93/vendor/licenses/config.yml#L2-L11"&gt;these&lt;/a&gt; licences. If you are new to textmate grammar, you can refer to &lt;a href="https://github.com/github/linguist/blob/master/CONTRIBUTING.md#fixing-syntax-highlighting"&gt;this&lt;/a&gt; section for more details.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; We add the repository which contains the grammar as a sub repository to the linguist repository. So whenever a new version of linguist repository is released, they update these sub modules as a part of the release process. So that means if you update your grammar in your repo, it will be reflected in GitHub after the next release of the linguist library. So you don’t have to send PRs to Linguist repo every time your grammar changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Ruby
&lt;/h3&gt;

&lt;p&gt;So the first thing I did was installing Ruby. It was fairly a straightforward process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Fork the repository.&lt;/li&gt;
&lt;li&gt;Clone the repository to your local machine.&lt;/li&gt;
&lt;li&gt;Create and checkout a new branch.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the Bundler using the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install bundler&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the directory and install the dependencies using the following commands.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bundle install&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;One mistake I did was I did not install the dependencies. This caused me few issues along the way. So I found out how to fix those issues the hard way :)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Adding Ballerina language
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Updating languages.yml
&lt;/h3&gt;

&lt;p&gt;So the first step is updating the &lt;em&gt;lib/linguist/languages.yml&lt;/em&gt; file. In here the &lt;strong&gt;tm_scope&lt;/strong&gt; field should have the scope name defined in the grammar. Make sure not to change already existing entries in the list. Also you can omit the &lt;strong&gt;language_id&lt;/strong&gt; field since it will be generated and added later.&lt;/p&gt;

&lt;p&gt;Also it is important to note that you cannot use a color which is similar to a color which is already in the linguist library. This is tested by &lt;em&gt;test/test_color_proximity.rb&lt;/em&gt; file. I guess this is done so that each language will have a distinguishable color.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9tAfNiGJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/sr2d5muvm7y7pf9kltvp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9tAfNiGJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/sr2d5muvm7y7pf9kltvp.png" alt="languages.yml"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding grammar
&lt;/h3&gt;

&lt;p&gt;So the next thing you want to do is adding the grammar using the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;script/add-grammar script/add-grammar https://github.com/ballerinalang/plugin-vscode&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will add the the repo as a sub module. The module name is &lt;em&gt;vendor/grammars/plugin-vscode&lt;/em&gt;. This was bit problematic since the name was too generic. So I had to rename the module name to more specific one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding samples
&lt;/h3&gt;

&lt;p&gt;Add few samples to samples/Ballerina directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NNsB4-dr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fb0tsvw09kw1i09vuc1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NNsB4-dr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/fb0tsvw09kw1i09vuc1y.png" alt="Samples"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Generating Language ID
&lt;/h3&gt;

&lt;p&gt;Now we have to generate a language ID for our language using the following command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;script/set-language-ids --update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will generate a new ID for our language.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing
&lt;/h3&gt;

&lt;p&gt;Now we have to test our changes. For this, run the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;script/bootstrap
bundle exec rake samples
bundle exec rake test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Sometimes getting the tests running can be too much work, especially if you don’t have much Ruby experience. It’s okay: be lazy and let our build bot Travis run the tests for you. Just open a pull request and the bot will start cranking away.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So if you decide to open a PR instead of testing by yourself, following section is for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Opening a PR
&lt;/h3&gt;

&lt;p&gt;Now you have done everything to add a new language. Commit the changes and open a PR. When sending the PR, you need to link GitHub search result which shows wide usage of your languages. For example, refer &lt;a href="https://github.com/search?utf8=%E2%9C%93&amp;amp;q=extension%3Abal+NOT+nothack&amp;amp;type=Code"&gt;this&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Linguist Community
&lt;/h2&gt;

&lt;p&gt;Developers in that community is very welcoming. My PR was reviewed very quickly. They pointed out the issues in my PR, so I was able to make sure that it is up to their community standard. If you need any help or if you have any questions, don’t hesitate to ask from them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ballerina in GitHub
&lt;/h2&gt;

&lt;p&gt;By adding Ballerina language to GitHub, we get following advantages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax highlighting for Ballerina files
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PtdIPOUY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kvm7024q5sbgzsjytbiz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PtdIPOUY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/kvm7024q5sbgzsjytbiz.png" alt="Syntax Highlighting"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  View Ballerina code percentage in repositories
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tHu2x3qB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7jak9ya0k9udzx7xnz00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tHu2x3qB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7jak9ya0k9udzx7xnz00.png" alt="Ballerina Code Percentage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Ballerina code snippet highlighting
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nOC42Nk0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tse4xg5rdqshsh68khcn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nOC42Nk0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tse4xg5rdqshsh68khcn.png" alt="Snippet Highlighting Source"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UdQz3RII--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/sn56qkzmpb4cvtkesf9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UdQz3RII--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/sn56qkzmpb4cvtkesf9f.png" alt="Snippet Highlighting Preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally to what others get from this, it was a massive opportunity for me to learn new things. Now every time I see a Ballerina code in GitHub, I feel very happy because I helped to make it happen. It was probably a once in a lifetime opportunity and I'm very glad that I grabbed it.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed this article. It was bit long, but I’m sure you learnt something new :)&lt;/p&gt;

</description>
      <category>github</category>
      <category>linguist</category>
      <category>ballerina</category>
      <category>wso2</category>
    </item>
  </channel>
</rss>
