Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

103/vscodeplugin #460

Closed
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions calm-extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.vscodeignore
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
out

dist
dist-ssr
*.local

11 changes: 11 additions & 0 deletions calm-extension/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/eslint.config.mjs
**/*.map
**/*.ts
**/.vscode-test.*
9 changes: 9 additions & 0 deletions calm-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

All notable changes to the "calm" 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
38 changes: 38 additions & 0 deletions calm-extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# CALM Extention

An extention designed to visualize CALM Schema in VS Code.
This tool can be used to visualize a CALM Instantiation from the command pallet of VS Code.

## Features
Visualize a diagram of your CALM instantiation from the VS Code command pallet.
Type: ``CALM: Calm Visualize Current Instantiation File``


## Requirements

Open the Instantiation document in and active vscode window before running the command.


## Known Issues

The extension currently does not visualize CALM patterns

## Release Notes

Users appreciate release notes as you update your extension.

### 1.0.0

Initial release of ...

### 1.0.1

Fixed issue #.

### 1.1.0

Added features X, Y, and Z.

---
![Image of the extension in action.](./media/extension.png)
![Image of Calm Instantiation diagram](./media/calmInstantiation.png)
28 changes: 28 additions & 0 deletions calm-extension/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [{
files: ["**/*.ts"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
},

rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],

curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "warn",
},
}];
Binary file added calm-extension/media/calmInstantiation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added calm-extension/media/extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions calm-extension/media/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
:root {
--container-padding: 20px;
--input-padding-vertical: 6px;
--input-padding-horizontal: 4px;
--input-margin-vertical: 4px;
--input-margin-horizontal: 0;
}

body {
padding: 0 var(--container-padding);
color: var(--vscode-foreground);
font-size: var(--vscode-font-size);
font-weight: var(--vscode-font-weight);
font-family: var(--vscode-font-family);
background-color: var(--vscode-editor-background);
}

ol,
ul {
padding-left: var(--container-padding);
}

body > *,
form > * {
margin-block-start: var(--input-margin-vertical);
margin-block-end: var(--input-margin-vertical);
}

*:focus {
outline-color: var(--vscode-focusBorder) !important;
}

a {
color: var(--vscode-textLink-foreground);
}

a:hover,
a:active {
color: var(--vscode-textLink-activeForeground);
}

code {
font-size: var(--vscode-editor-font-size);
font-family: var(--vscode-editor-font-family);
}

button {
border: none;
padding: var(--input-padding-vertical) var(--input-padding-horizontal);
width: 100%;
text-align: center;
outline: 1px solid transparent;
outline-offset: 2px !important;
color: var(--vscode-button-foreground);
background: var(--vscode-button-background);
}

button:hover {
cursor: pointer;
background: var(--vscode-button-hoverBackground);
}

button:focus {
outline-color: var(--vscode-focusBorder);
}

button.secondary {
color: var(--vscode-button-secondaryForeground);
background: var(--vscode-button-secondaryBackground);
}

button.secondary:hover {
background: var(--vscode-button-secondaryHoverBackground);
}

input:not([type='checkbox']),
textarea {
display: block;
width: 100%;
border: none;
font-family: var(--vscode-font-family);
padding: var(--input-padding-vertical) var(--input-padding-horizontal);
color: var(--vscode-input-foreground);
outline-color: var(--vscode-input-border);
background-color: var(--vscode-input-background);
}

input::placeholder,
textarea::placeholder {
color: var(--vscode-input-placeholderForeground);
}
91 changes: 91 additions & 0 deletions calm-extension/media/vscode.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
:root {
--container-padding: 20px;
--input-padding-vertical: 6px;
--input-padding-horizontal: 4px;
--input-margin-vertical: 4px;
--input-margin-horizontal: 0;
}

body {
padding: 0 var(--container-padding);
color: var(--vscode-foreground);
font-size: var(--vscode-font-size);
font-weight: var(--vscode-font-weight);
font-family: var(--vscode-font-family);
background-color: var(--vscode-editor-background);
}

ol,
ul {
padding-left: var(--container-padding);
}

body > *,
form > * {
margin-block-start: var(--input-margin-vertical);
margin-block-end: var(--input-margin-vertical);
}

*:focus {
outline-color: var(--vscode-focusBorder) !important;
}

a {
color: var(--vscode-textLink-foreground);
}

a:hover,
a:active {
color: var(--vscode-textLink-activeForeground);
}

code {
font-size: var(--vscode-editor-font-size);
font-family: var(--vscode-editor-font-family);
}

button {
border: none;
padding: var(--input-padding-vertical) var(--input-padding-horizontal);
width: 100%;
text-align: center;
outline: 1px solid transparent;
outline-offset: 2px !important;
color: var(--vscode-button-foreground);
background: var(--vscode-button-background);
}

button:hover {
cursor: pointer;
background: var(--vscode-button-hoverBackground);
}

button:focus {
outline-color: var(--vscode-focusBorder);
}

button.secondary {
color: var(--vscode-button-secondaryForeground);
background: var(--vscode-button-secondaryBackground);
}

button.secondary:hover {
background: var(--vscode-button-secondaryHoverBackground);
}

input:not([type='checkbox']),
textarea {
display: block;
width: 100%;
border: none;
font-family: var(--vscode-font-family);
padding: var(--input-padding-vertical) var(--input-padding-horizontal);
color: var(--vscode-input-foreground);
outline-color: var(--vscode-input-border);
background-color: var(--vscode-input-background);
}

input::placeholder,
textarea::placeholder {
color: var(--vscode-input-placeholderForeground);
}
45 changes: 45 additions & 0 deletions calm-extension/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "calm-plugin",
"displayName": "calm-plugin",
"description": "",
"version": "0.0.1",
"engines": {
"vscode": "^1.93.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:caml.visualize"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "calm.visualize.instantiation",
"title": "Calm Visualize Instantiation File",
"category": "CALM"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src"
},
"devDependencies": {
"@types/node": "20.x",
"@types/vscode": "^1.93.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"eslint": "^9.9.1",
"typescript": "^5.6.2"
},
"dependencies": {
"@viz-js/viz": "^3.9.0",
"ts-graphviz": "^2.1.4",
"winston": "^3.14.1"
}
}
Loading