Skip to content

Commit

Permalink
feat(web): update vscode extension: disable command and webview, upda…
Browse files Browse the repository at this point in the history
…te assets, fix tmlanguage yaml syntax highlighting
  • Loading branch information
emil14 committed Jan 29, 2024
1 parent 5c8078c commit 809164b
Show file tree
Hide file tree
Showing 21 changed files with 266 additions and 85 deletions.
Binary file removed assets/header.png
Binary file not shown.
45 changes: 45 additions & 0 deletions assets/header/big.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions assets/header/small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions assets/logo.svg

This file was deleted.

5 changes: 5 additions & 0 deletions assets/logo/dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions assets/logo/dark_gradient.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/logo/light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions assets/logo/light_gradient.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions assets/logo/square_gradient.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions examples/5_add_real_numbers/with_sub_components/main.neva
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {

components {
Main(enter any) (exit any) {
nodes { aux Aux }
nodes {
aux Aux
}
net {
in:enter -> aux:sig
aux:res -> printer:msg
Expand All @@ -20,7 +22,9 @@ components {
nodes {
reader1 IntReader
reader2 IntReader
adder PortBridge { handler Adder<int> }
adder PortBridge {
handler Adder<int>
}
}
net {
in:enter -> reader1.sig
Expand Down
29 changes: 17 additions & 12 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
# VSCode Neva

> **IMPORTANT**: You need to have `neva.yaml` or `neva.yml` in the root of your workspace folder to the activate the extension.
# Neva Programming Language

![Logo of the language](./assets/header.png "Nevalang logo and title")

This is VSCode extension for [Neva](https://github.com/nevalang/neva) - flow-based programming language.
This is extension for [Neva](https://github.com/nevalang/neva) - flow based programming language.

## Features
Please note that you need to have `neva.yaml` in the root of your workspace to activate extension.

### Custom Editor
## Requirements

Open `.neva` file in VSCode to activate visual editor.
- [Neva](https://github.com/nevalang/neva) programming language installed

### Syntax Highlighting
## Features

Feel free to edit `.neva` files in old-school text-mode:
### Syntax Highlighting

![Picture of a syntax highlighting](./assets/code.png "Syntax highlighting example")

## Requirements
### Error messages (Diagnostics)

- [Neva](https://github.com/nevalang/neva) programming language installed
Error messages occur as you type in _problems_ panel

## Contributing

See [./Contributing.md](Contributing.md)

## Release Notes

### 0.3.0

- Web-view temporary removed after massive rewriting of the language
- Updated syntax highlighting to match **new grammar**
- Updated icons for command menu and files
- Updated header with **new logo**

### 0.2.0

- **LSP**-compatible **Language Server**
- **WebView**-based **Custom editor** for visual editing of `.neva` files

### 0.1.0

First release with textmate (regexp) based **syntax highlighting**.
- First release with textmate (regexp) based **syntax highlighting**.
8 changes: 0 additions & 8 deletions web/assets/file-icon.svg

This file was deleted.

Binary file modified web/assets/header.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 removed web/assets/logo.png
Binary file not shown.
5 changes: 5 additions & 0 deletions web/assets/logo.svg
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 web/assets/logo_gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 4 additions & 21 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
],
"configuration": "./language-configuration.json",
"icon": {
"light": "./assets/file-icon.svg",
"dark": "./assets/file-icon.svg"
"light": "./assets/logo.svg",
"dark": "./assets/logo.svg"
}
}
],
Expand All @@ -73,30 +73,13 @@
"scopeName": "source.neva",
"path": "./syntaxes/neva.tmLanguage.json"
}
],
"commands": [
{
"command": "neva.openPreview",
"title": "Preview 👀",
"icon": "$(eye)",
"category": "Neva"
}
],
"menus": {
"editor/title": [
{
"when": "editorLangId == neva",
"command": "neva.openPreview",
"group": "navigation"
}
]
}
]
},
"activationEvents": [
"workspaceContains:neva.yml",
"workspaceContains:neva.yaml"
],
"icon": "assets/logo.png",
"icon": "./assets/logo.png",
"dependencies": {
"vscode": "^1.1.37",
"vscode-languageclient": "^9.0.1"
Expand Down
60 changes: 44 additions & 16 deletions web/syntaxes/neva.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,36 @@
"storage_types": {
"patterns": [
{
"match": "\\bbool\\b",
"name": "storage.type.boolean"
"match": "\\bany\\b",
"name": "storage.type.any"
},
{
"match": "\\berror\\b",
"name": "storage.type.error"
"match": "\\bmaybe\\b",
"name": "storage.type.maybe"
},
{
"match": "\\bbool\\b",
"name": "storage.type.boolean"
},
{
"match": "\\b(int|float)\\b",
"name": "storage.type.numeric"
},
{
"match": "\\bstr\\b",
"match": "\\bstring\\b",
"name": "storage.type.string"
},
{
"match": "\\bany\\b",
"name": "storage.type.any"
"match": "\\bmap\\b",
"name": "storage.type.map"
},
{
"match": "\\blist\\b",
"name": "storage.type.list"
},
{
"match": "\\berror\\b",
"name": "storage.type.error"
},
{
"include": "#struct_type"
Expand Down Expand Up @@ -166,6 +178,30 @@
"end": "(?:\\n|$)"
}
]
},
"component_nodes": {
"patterns": [
{
"include": "#storage_types"
},
{
"match": "^(\\s*)\\b(\\w+)\\b",
"captures": {
"2": {
"name": "variable.other.node"
}
}
},
{
"begin": "\\{",
"end": "\\}",
"patterns": [
{
"include": "#component_nodes"
}
]
}
]
}
},
"patterns": [
Expand Down Expand Up @@ -315,15 +351,7 @@
"end": "\\}",
"patterns": [
{
"include": "#storage_types"
},
{
"match": "^(\\s*)\\b(\\w+)\\b",
"captures": {
"2": {
"name": "variable.other.node"
}
}
"include": "#component_nodes"
}
]
},
Expand Down
19 changes: 14 additions & 5 deletions web/syntaxes/neva.tmLanguage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ repository:
name: meta.directive
end: "(?:\\n|$)" # Matches the end of a line or the end of the input

# Component nodes
component_nodes:
patterns:
- include: "#storage_types"
- match: "^(\\s*)\\b(\\w+)\\b" # Matches a line with some whitespace, followed by a word
captures:
"2":
name: variable.other.node
- begin: "\\{"
end: "\\}"
patterns:
- include: "#component_nodes"

# ----------------------------------------------------------------
# Patterns (actual rules)
# ----------------------------------------------------------------
Expand Down Expand Up @@ -216,11 +229,7 @@ patterns:
name: entity.name.section
end: "\\}" # Matches a closing curly brace
patterns:
- include: "#storage_types"
- match: "^(\\s*)\\b(\\w+)\\b" # Matches a line with some whitespace, followed by a word (node identifier)
captures:
"2":
name: variable.other.node
- include: "#component_nodes"

# Component Net
- begin: "\\b(net)\\s*\\{" # Matches the keyword 'net' followed by optional whitespace and an opening curly brace
Expand Down
Loading

0 comments on commit 809164b

Please sign in to comment.