Skip to content
Snippets Groups Projects
Commit a9479868 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

Merged code from private repo


Signed-off-by: default avatarMiklos Magyari <miklos.magyari@sigmatechnology.com>
parents b611e42b 4d0b546d
Branches main
No related tags found
No related merge requests found
Showing with 5301 additions and 1 deletion
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
out
dist
node_modules
.vscode-test/
server/
*.vsix
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
\ No newline at end of file
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
# Change Log
All notable changes to the "titan" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [Unreleased]
- Initial release
\ No newline at end of file
readme # titan README
Experimental Vscode extension for ttcn3.
Talks to an experimental language server written using LSP4j.
{
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"comments": {
"lineComment": "//",
"blockComment": [ "/*", "*/" ]
}
}
\ No newline at end of file
This diff is collapsed.
{
"name": "titan",
"displayName": "Titan",
"description": "Titan ttcn3 extension",
"repository": {
"type": "git",
"url": "https://github.com/MiklosMagyari/TitanExtension"
},
"version": "0.1.6",
"engines": {
"vscode": "^1.71.0"
},
"categories": [
"Snippets",
"Other"
],
"activationEvents": [
"onLanguage:ttcn",
"onLanguage:asn1",
"onLanguage:cfg",
"workspaceContains:**/^.*\\.(ttcn|ttcn3|asn|asn1|ttcnpp|ttcnpp3|tpd|cfg)$"
],
"main": "./out/extension.js",
"contributes": {
"languages": [
{
"id": "ttcn",
"extensions": [
".ttcn",
".ttcn3"
],
"aliases": [
"Ttcn3", "ttcn", "TTCN", "ttcn3", "TTCN3"
],
"configuration": "./language-configuration.json"
},
{
"id": "asn1",
"extensions": [ ".asn", ".asn1" ],
"aliases": [ "ASN", "asn", "ASN1", "asn1", "ASN.1", "asn.1" ],
"configuration": "./language-configuration.json"
},
{
"id": "cfg",
"extensions": [ ".cfg" ],
"aliases": [ "cfg", "Cfg" ],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"path": "./syntaxes/ttcn.tmLanguage.json",
"scopeName": "source.ttcn",
"language": "ttcn"
},
{
"path": "./syntaxes/asn1.tmLanguage.json",
"scopeName": "source.asn1",
"language": "asn1"
},
{
"path": "./syntaxes/cfg.tmLanguage.json",
"scopeName": "source.cfg",
"language": "cfg"
}
],
"views": {
"explorer": [
{
"id": "tpdview",
"name": "TPD files"
}
]
},
"commands":[
{
"command": "tpdview.addFile",
"title": "Add TPD...",
"icon": "$(search-new-editor)"
}
],
"menus":{
"view/title":[
{
"command": "tpdview.addFile",
"when": "view == tpdview",
"group": "navigation"
}
]
},
"snippets": [
{
"language": "ttcn",
"path": "./snippets/ttcn.json"
},
{
"language": "asn1",
"path": "./snippets/asn1.json"
},
{
"language": "cfg",
"path": "./snippets/cfg.json"
}
],
"configuration": {
"type": "object",
"title": "Titan configuration",
"properties": {
"titan.onTheFlyChecker.enableOop": {
"type": "boolean",
"default": true,
"description": "Enable ttcn3 object oriented extension"
},
"titan.onTheFlyChecker.enableRealtime": {
"type": "boolean",
"default": false,
"description": "Enable ttcn3 realtime extension"
},
"titan.onTheFlyChecker.enableDocComments": {
"type": "boolean",
"default": true,
"description": "Enable parsing of document comments"
},
"titan.onTheFlyChecker.enableNamingConventionCheck": {
"type": "boolean",
"default": true,
"description": "Enable checking of naming conventions"
},
"titan.onTheFlyChecker.namingConventionSeverity": {
"type": "string",
"default": "warning",
"description": "Severity of naming convention violations"
},
"titan.namingConvention.testcase": {
"type": "string",
"default": "tc_*",
"description": "Naming convention for testcases"
},
"titan.compiler.tpdFiles": {
"type": "array",
"description": "Tpd files"
},
"titan.compiler.compilerBinaryPath": {
"type": "string",
"default": "/tmp",
"description": "Path to titan.core compiler binary"
},
"titan.outline.showFunctions": {
"type": "boolean",
"default": "true",
"description": "Show function definitions in the outline"
},
"titan.outline.showTestcases": {
"type": "boolean",
"default": "true",
"description": "Show testcases in the outline"
},
"titan.outline.showClasses": {
"type": "boolean",
"default": "true",
"description": "Show class definitions in the outline"
},
"titan.maxNumberOfProblems": {
"type": "number",
"default": 100,
"description": "Controls the maximum number of problems produced by the server."
},
"ttcnserver.trace.server": {
"scope": "window",
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"default": "verbose",
"description": "Traces the communication between VSCode and the languageServerExample service."
}
}
}
},
"dependencies": {
"fast-xml-parser": "^4.0.11",
"vscode-languageclient": "^7.0.0"
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/glob": "^7.2.0",
"@types/mocha": "^9.1.1",
"@types/node": "16.x",
"@types/vscode": "^1.71.0",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"@vscode/test-electron": "^2.1.5",
"eslint": "^8.20.0",
"glob": "^8.0.3",
"mocha": "^10.0.0",
"typescript": "^4.7.4"
}
}
{
"ASN1 empty module": {
"prefix": ["def"],
"description": "ASN1 empty module",
"body":
[
" DEFINITIONS",
"",
" AUTOMATIC TAGS ::=",
"",
"BEGIN",
"",
"END"
]
},
"ASN1 module": {
"prefix": ["def"],
"description": "ASN1 module",
"body":
[
" DEFINITIONS",
"",
"-- [(AUTOMATIC|EXPLICIT|IMPLICIT) TAGS]",
"-- the default is EXPLICIT TAGS",
" AUTOMATIC TAGS ::=",
"",
"BEGIN",
"-- EXPORTS <exports clause>;",
"-- IMPORTS <import clause>;",
"-- MODULE-BODY",
"",
"END"
]
},
"SEQUENCE": {
"prefix": ["seq"],
"description": "SEQUENCE",
"body":
[
"SEQUENCE {",
"${1:field1} ${2:subType1},",
"${3:field2} ${4:subType2} }"
]
},
"SEQUENCE OF": {
"prefix": ["seq"],
"description": "SEQUENCE OF",
"body":
[
"SEQUENCE OF ${1:constraint} OF ${2:type}"
]
},
"SET": {
"prefix": ["set"],
"description": "SET",
"body":
[
"SET {",
"${1:field1} ${2:subType1},",
"${3:field2} ${4:subType2} }"
]
},
"SET OF": {
"prefix": ["set"],
"description": "SET OF",
"body":
[
"SET OF ${1:constraint} OF ${2:type}"
]
},
"CHOICE": {
"prefix": ["cho"],
"description": "CHOICE",
"body":
[
"CHOICE {",
"${1:field1} ${2:subType1},",
"${3:field2} ${4:subType2} }"
]
},
"ENUMERATED": {
"prefix": ["enu"],
"description": "ENUMERATED",
"body":
[
"ENUMERATED { ${1:identifier1}( ${2:value1} ), ${3:identifier2}( ${4:value2} ) } ${5:fieldIdentifier}"
]
},
"COMPONENTS": {
"prefix": ["com"],
"description": "COMPONENTS OF",
"body":
[
"COMPONENTS OF ${1:type_assignment}"
]
},
"CLASS": {
"prefix": ["cla"],
"description": "Object Class",
"body":
[
"${1:IDENTIFIER} := CLASS {",
"&${2:field1} ${3:type1} ${4:UNIQUE} ${5:OPTIONAL},",
"&${6:field2} ${7:type2} ${8:UNIQUE} ${9:OPTIONAL}",
"}"
]
},
"CLASS user defined": {
"prefix": ["cla"],
"description": "Object Class with user defined syntax",
"body":
[
"${1:IDENTIFIER} := CLASS {",
"&${2:field1} ${3:type1} ${4:UNIQUE} ${5:OPTIONAL},",
"&${6:field2} ${7:type2} ${8:UNIQUE} ${9:OPTIONAL}",
"} WITH SYNTAX {",
"${10:FIELD1} &${11:field1}",
"${12:FIELD2} &${13:field2}"
]
},
"OBJECTSET": {
"prefix": ["obj"],
"description": "Object Set",
"body":
[
"${1:Identifier} ${2:OBJECT-CLASS} := {",
"${3:first-object} |",
"${4:second-object}",
"}"
]
},
"VALUESET": {
"prefix": ["val"],
"description": "Value Set",
"body":
[
"${1:Identifier} ${2:type} := {",
"${3:first-value} |",
"${4:second-value}",
"}"
]
}
}
\ No newline at end of file
{
"config skeleton": {
"prefix": "[",
"description": "Config skeleton",
"body":
[
"[MODULE_PARAMETERS]",
"# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.",
"",
"[LOGGING]",
"# In this section you can specify the name of the log file and the classes of events",
"# you want to log into the file or display on console (standard error).",
"",
"LogFile := \"logs/%e.%h-%r.%s\"",
"FileMask := LOG_ALL | DEBUG | MATCHING",
"ConsoleMask := ERROR | WARNING | TESTCASE | STATISTICS | PORTEVENT",
"LogSourceInfo := Yes",
"AppendFile := No",
"TimeStampFormat := DateTime",
"LogEventTypes := Yes",
"SourceInfoFormat := Single",
"LogEntityName := Yes",
"",
"[TESTPORT_PARAMETERS]",
"# In this section you can specify parameters that are passed to Test Ports.",
"",
"[DEFINE]",
"# In this section you can create macro definitions,",
"# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE].",
"",
"[INCLUDE]",
"# To use configuration settings given in other configuration files,",
"# the configuration files just need to be listed in this section, with their full or relative pathnames.",
"",
"[ORDERED_INCLUDE]",
"# To use configuration settings given in other configuration files,",
"# the configuration files just need to be listed in this section, with their full or relative pathnames.",
"",
"[EXTERNAL_COMMANDS]",
"# This section can define external commands (shell scripts) to be executed by the ETS",
"# whenever a control part or test case is started or terminated.",
"",
"#BeginTestCase := \"\"",
"#EndTestCase := \"\"",
"#BeginControlPart := \"\"",
"#EndControlPart := \"\"",
"",
"[EXECUTE]",
"# In this section you can specify what parts of your test suite you want to execute.",
"",
"[GROUPS]",
"# In this section you can specify groups of hosts. These groups can be used inside the",
"# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.",
"",
"[COMPONENTS]",
"# This section consists of rules restricting the location of created PTCs.",
"",
"[MAIN_CONTROLLER]",
"# The options herein control the behavior of MC.",
"",
"TCPPort := 0",
"KillTimer := 10.0",
"# NumHCs := 0",
"# LocalAddress := "
]
}
}
\ No newline at end of file
{
"Ttcn3 module": {
"prefix": ["mod"],
"body": ["module $0 {\n\t\n}\n"],
"description": "ttcn3 module"
}
}
\ No newline at end of file
This diff is collapsed.
import * as path from 'path';
import { runTests } from '@vscode/test-electron';
async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');
// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}
main();
import * as assert from 'assert';
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../../extension';
suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
test('Sample test', () => {
assert.strictEqual(-1, [1, 2, 3].indexOf(5));
assert.strictEqual(-1, [1, 2, 3].indexOf(0));
});
});
import * as path from 'path';
import * as Mocha from 'mocha';
import * as glob from 'glob';
export function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd',
color: true
});
const testsRoot = path.resolve(__dirname, '..');
return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
try {
// Run the mocha test
mocha.run(failures => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
console.error(err);
e(err);
}
});
});
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment