Skip to content

Commit

Permalink
initital MSG and NED implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgeorge309 authored and rhornig committed Sep 4, 2024
1 parent b3a7e3b commit e439815
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# local and generated files not to be committed
node_modules/*
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "subprojects/omnetpp-textmate-ned"]
path = subprojects/omnetpp-textmate-ned
url = https://github.com/omnetpp/omnetpp-textmate-ned
[submodule "subprojects/omnetpp-textmate-msg"]
path = subprojects/omnetpp-textmate-msg
url = https://github.com/omnetpp/omnetpp-textmate-msg
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
TextMate grammar and Visual Studio Code extension for the OMNeT++ NED language.
TextMate grammar and Visual Studio Code extension for the OMNeT++ NED and MSG languages.

## Features

Syntax highlighting of .ned files.
Syntax highlighting of .ned and .msg files.

## Requirements

VS Code version 1.92 or higher.

## Building locally

Node.js is required for building the extension locally (see https://nodejs.org for install instructions).

- Clone this repo
- Run `refresh_submodules` to fetch the grammar submodules
- Install `vsce`: `npm install -g @vscode/vsce`

To build the .vsix file, run:

`npm run package`

## Installing

In VSCode/Extensions, select 'Install from VSIX...' from the ... menu
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "omnetpp-vscode",
"displayName": "omnetpp-vscode",
"description": "Extension for the OMNeT++ NED and MSG languages",
"version": "0.0.1",
"publisher": "opensim",
"repository": "https://github.com/adamgeorge309/omnetpp-vscode",
"icon": "logo128.png",
"engines": {
"vscode": "^1.92.0"
},
"categories": [
"Programming Languages"
],
"scripts": {
"test": "echo \"Error: no test specified\"",
"package": "vsce package",
"deploy": "vsce publish --yarn"
},
"contributes": {
"languages": [
{
"id": "omnetpp-ned",
"extensions": [
".ned"
],
"configuration": "./language-configuration.json"
},
{
"id": "omnetpp-msg",
"extensions": [".msg"],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "omnetpp-ned",
"scopeName": "source.ned",
"path": "./syntaxes/ned.tmLanguage.json"
},
{
"language": "omnetpp-msg",
"scopeName": "source.msg",
"path": "./syntaxes/omnetpp-msg.tmLanguage.json"
}
]
},
"devDependencies": {
"@vscode/vsce": "^3.0.0"
}
}
3 changes: 3 additions & 0 deletions refresh_submodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
echo 'Refreshing submodules....'
cd subprojects
git submodule init && git submodule update
1 change: 1 addition & 0 deletions subprojects/omnetpp-textmate-msg
Submodule omnetpp-textmate-msg added at e14a55
1 change: 1 addition & 0 deletions subprojects/omnetpp-textmate-ned
Submodule omnetpp-textmate-ned added at 8b5453
1 change: 1 addition & 0 deletions syntaxes/ned.tmLanguage.json
1 change: 1 addition & 0 deletions syntaxes/omnetpp-msg.tmLanguage.json
29 changes: 29 additions & 0 deletions vsc-extension-quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Welcome to your VS Code Extension

## What's in the folder

* This folder contains all of the files necessary for your extension.
* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension.
* `syntaxes/ned.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization.
* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets.

## Get up and running straight away

* Make sure the language configuration settings in `language-configuration.json` are accurate.
* Press `F5` to open a new window with your extension loaded.
* Create a new file with a file name suffix matching your language.
* Verify that syntax highlighting works and that the language configuration settings are working.

## Make changes

* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.

## Add more language features

* To add features such as IntelliSense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs

## Install your extension

* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.

0 comments on commit e439815

Please sign in to comment.