Skip to content

Commit e439815

Browse files
adamgeorge309rhornig
authored andcommitted
initital MSG and NED implementation
1 parent b3a7e3b commit e439815

10 files changed

+113
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# local and generated files not to be committed
2+
node_modules/*

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "subprojects/omnetpp-textmate-ned"]
2+
path = subprojects/omnetpp-textmate-ned
3+
url = https://github.com/omnetpp/omnetpp-textmate-ned
4+
[submodule "subprojects/omnetpp-textmate-msg"]
5+
path = subprojects/omnetpp-textmate-msg
6+
url = https://github.com/omnetpp/omnetpp-textmate-msg

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1-
TextMate grammar and Visual Studio Code extension for the OMNeT++ NED language.
1+
TextMate grammar and Visual Studio Code extension for the OMNeT++ NED and MSG languages.
22

33
## Features
44

5-
Syntax highlighting of .ned files.
5+
Syntax highlighting of .ned and .msg files.
66

77
## Requirements
88

99
VS Code version 1.92 or higher.
10+
11+
## Building locally
12+
13+
Node.js is required for building the extension locally (see https://nodejs.org for install instructions).
14+
15+
- Clone this repo
16+
- Run `refresh_submodules` to fetch the grammar submodules
17+
- Install `vsce`: `npm install -g @vscode/vsce`
18+
19+
To build the .vsix file, run:
20+
21+
`npm run package`
22+
23+
## Installing
24+
25+
In VSCode/Extensions, select 'Install from VSIX...' from the ... menu

package.json

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "omnetpp-vscode",
3+
"displayName": "omnetpp-vscode",
4+
"description": "Extension for the OMNeT++ NED and MSG languages",
5+
"version": "0.0.1",
6+
"publisher": "opensim",
7+
"repository": "https://github.com/adamgeorge309/omnetpp-vscode",
8+
"icon": "logo128.png",
9+
"engines": {
10+
"vscode": "^1.92.0"
11+
},
12+
"categories": [
13+
"Programming Languages"
14+
],
15+
"scripts": {
16+
"test": "echo \"Error: no test specified\"",
17+
"package": "vsce package",
18+
"deploy": "vsce publish --yarn"
19+
},
20+
"contributes": {
21+
"languages": [
22+
{
23+
"id": "omnetpp-ned",
24+
"extensions": [
25+
".ned"
26+
],
27+
"configuration": "./language-configuration.json"
28+
},
29+
{
30+
"id": "omnetpp-msg",
31+
"extensions": [".msg"],
32+
"configuration": "./language-configuration.json"
33+
}
34+
],
35+
"grammars": [
36+
{
37+
"language": "omnetpp-ned",
38+
"scopeName": "source.ned",
39+
"path": "./syntaxes/ned.tmLanguage.json"
40+
},
41+
{
42+
"language": "omnetpp-msg",
43+
"scopeName": "source.msg",
44+
"path": "./syntaxes/omnetpp-msg.tmLanguage.json"
45+
}
46+
]
47+
},
48+
"devDependencies": {
49+
"@vscode/vsce": "^3.0.0"
50+
}
51+
}

refresh_submodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
echo 'Refreshing submodules....'
2+
cd subprojects
3+
git submodule init && git submodule update

subprojects/omnetpp-textmate-msg

Submodule omnetpp-textmate-msg added at e14a552

subprojects/omnetpp-textmate-ned

Submodule omnetpp-textmate-ned added at 8b54539

syntaxes/ned.tmLanguage.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../subprojects/omnetpp-textmate-ned/syntaxes/ned.tmLanguage.json

syntaxes/omnetpp-msg.tmLanguage.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../subprojects/omnetpp-textmate-msg/syntaxes/omnetpp-msg.tmLanguage.json

vsc-extension-quickstart.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Welcome to your VS Code Extension
2+
3+
## What's in the folder
4+
5+
* This folder contains all of the files necessary for your extension.
6+
* `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.
7+
* `syntaxes/ned.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization.
8+
* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets.
9+
10+
## Get up and running straight away
11+
12+
* Make sure the language configuration settings in `language-configuration.json` are accurate.
13+
* Press `F5` to open a new window with your extension loaded.
14+
* Create a new file with a file name suffix matching your language.
15+
* Verify that syntax highlighting works and that the language configuration settings are working.
16+
17+
## Make changes
18+
19+
* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
20+
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
21+
22+
## Add more language features
23+
24+
* To add features such as IntelliSense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs
25+
26+
## Install your extension
27+
28+
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
29+
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.

0 commit comments

Comments
 (0)