Skip to content

Commit

Permalink
wip: wasm onesdk
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEdward162 committed Feb 8, 2024
1 parent 988e4f0 commit c79debd
Show file tree
Hide file tree
Showing 16 changed files with 287 additions and 2,219 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist/
yalc.lock
fixtures/*
*.vsix
docs/*.mov
docs/*.mov
workdir
15 changes: 1 addition & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,7 @@
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
},
{
"type": "node",
"request": "attach",
"name": "Attach to Server",
"port": 7357,
"restart": true
"outFiles": ["${workspaceFolder}/dist/**/*"]
}
],
"compounds": [
{
"name": "Client + Server",
"configurations": ["Launch Client", "Attach to Server"]
}
]
}
16 changes: 0 additions & 16 deletions .vscode/tasks.json

This file was deleted.

5 changes: 2 additions & 3 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
**/*

!README.md
!LICENSE.md
!LICENSE

!node_modules/
!dist/

!package.json
!syntaxes/*.json
!snippets/*.json
!docs/*
!docs/*
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Superface s.r.o.
Copyright (c) 2024 Superface s.r.o.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,22 @@ code --install-extension <path-to-vsix>
## Usage

The extension provides following features:
* Syntax highlighting for Comlink maps and profiles
* Code snippets for Comlink maps and profiles
* JSON schemas for Comlink ASTs and super.json
* Superface outline view to show super.json configuration in current workspace
* Bundled [language server](https://github.com/superfaceai/language-server)
- Syntax checking
- Semantic linting
- Workspace symbol search (requires VSCode to be open in workspace mode)

![preview](docs/preview.gif)

## Development

When developing, start with cloning the repository using `git clone https://github.com/superfaceai/language-client-vscode.git` (or `git clone git@github.com:superfaceai/language-client-vscode.git` if you have repository access).

After cloning, the dependencies must be downloaded using `yarn install` or `npm install`.
After cloning, the dependencies must be downloaded using `yarn install`.

Now the repository is ready for code changes.

To test your changes there is a launch task prepared in the `.vscode` folder. Open the Run tab in your vscode and select the task "Launch Client". Then click the "Start Debugging" button or F5 and a new vscode window should open up with the WIP extension active.

The `package.json` also contains scripts (runnable by calling `yarn <script-name>` or `npm run <script-name>`):
- `lint` - lint the code (use `lint:fix` to run autofix)
- `format` - check the code formatting (use `format:fix` to autoformat)
- `build` - run the typescript compiler
- `prepush` - run `test`, `lint` and `format` checks. This should run without errors before you push anything to git.
- `package` - package the built output into a vsix extension

To install the extension from a local build, execute the `build` script, then the `package` script and then [install](#install) the generated vsix artifact.
Expand Down Expand Up @@ -89,4 +79,4 @@ Note: If editing the README, please conform to the [standard-readme](https://git
## License

The Superface is licensed under the [MIT](LICENSE).
© 2022 Superface
© 2024 Superface
120 changes: 19 additions & 101 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
"displayName": "Superface Language Client",
"description": "Superface Language Client for Visual Studio Code",
"icon": "docs/LogoGreen.png",
"version": "1.3.0",
"version": "2.0.0",
"repository": "https://github.com/superfaceai/language-client-vscode",
"author": "Superface Team",
"publisher": "superfaceai",
"license": "MIT",
"files": [
"dist/**/*",
"syntaxes/**/*.tmLanguage.json"
"dist/**/*"
],
"devDependencies": {
"@types/node": "^18.11.9",
"@types/vscode": "1.70.0",
"@types/vscode": "1.75.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@vscode/vsce": "^2.22.0",
"esbuild": "^0.19.11",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.2",
Expand All @@ -25,19 +26,16 @@
"eslint-plugin-simple-import-sort": "^8.0.0",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"typescript": "^4.8.4",
"vsce": "^2.14.0"
"typescript": "^5",
"vscode-languageclient": "^9.0.1"
},
"dependencies": {
"@superfaceai/language-server": "1.1.2",
"@superfaceai/one-sdk": "^2.3.0",
"ajv": "^8.11.0",
"jsonc-parser": "^3.2.0",
"vscode-languageclient": "^8.0.2"
"@superfaceai/language-server": "link:../one-sdk/packages/comlink_language_server"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"build:watch": "yarn build --watch",
"build": "yarn build:client && yarn build:server",
"build:client": "esbuild src/extension.ts --bundle --target=es2020 --platform=node --tree-shaking=true --outdir=dist --external:vscode",
"build:server": "yarn install --production --modules-folder dist/node_modules",
"prebuild": "yarn clean",
"clean": "rimraf dist/",
"lint": "eslint src/",
Expand All @@ -47,17 +45,16 @@
"prepush": "yarn lint && yarn format",
"package": "vsce package --yarn",
"deploy:vsce": "vsce publish --yarn",
"deploy:osvx": "echo 'use `npx osvx publish`' instead"
"deploy:osvx": "npx osvx publish"
},
"engines": {
"vscode": "^1.70.0"
"vscode": "^1.85.0"
},
"main": "dist/extension.js",
"activationEvents": [
"onLanguage:comlink-map",
"onLanguage:comlink-profile",
"onView:superfaceOutline"
"onLanguage:typescript",
"onLanguage:javascript"
],
"main": "dist/extension",
"contributes": {
"configuration": {
"type": "object",
Expand All @@ -69,11 +66,12 @@
"default": true,
"description": "Controls whether the language server is enabled."
},
"superfaceLanguageClient.languageServer.trace": {
"superfaceLanguageClient.languageServer.trace.server": {
"scope": "window",
"type": "string",
"enum": [
"off",
"compact",
"messages",
"verbose"
],
Expand All @@ -92,93 +90,13 @@
"category": "Superface",
"command": "superfaceLanguageClient.commands.languageServer.stop",
"title": "Stop Comlink language server"
},
{
"category": "Superface",
"command": "superfaceLanguageClient.commands.outline.refresh",
"title": "Refresh Superface Outline",
"icon": "$(refresh)"
}
],
"languages": [
{
"id": "comlink-map",
"aliases": [
"Comlink Map",
"Superface Map"
],
"extensions": [
".suma"
],
"configuration": "syntaxes/language-configuration.json"
},
{
"id": "comlink-profile",
"aliases": [
"Comlink Profile",
"Superface Profile"
],
"extensions": [
".supr"
],
"configuration": "syntaxes/language-configuration.json"
}
],
"grammars": [
{
"language": "comlink-map",
"scopeName": "source.comlink.map",
"path": "syntaxes/comlink-map.tmLanguage.json",
"embeddedLanguages": {
"meta.expression.jessie.comlink.map": "javascript"
}
},
{
"language": "comlink-profile",
"scopeName": "source.comlink.profile",
"path": "syntaxes/comlink-profile.tmLanguage.json"
}
],
"snippets": [
{
"language": "comlink-map",
"path": "snippets/comlink-map.snippets.json"
},
{
"language": "comlink-profile",
"path": "snippets/comlink-profile.snippets.json"
}
],
"jsonValidation": [
{
"fileMatch": "*.suma.ast.json",
"url": "https://raw.githubusercontent.com/superfaceai/ast-js/main/src/interfaces/ast/map-ast.schema.json"
},
{
"fileMatch": "*.supr.ast.json",
"url": "https://raw.githubusercontent.com/superfaceai/ast-js/main/src/interfaces/ast/profile-ast.schema.json"
},
{
"fileMatch": "super.json",
"url": "https://superface.ai/docs/comlink/super.json"
}
],
"views": {
"explorer": [
{
"id": "superfaceOutline",
"name": "Superface Outline"
}
]
},
"menus": {
"view/title": [
{
"command": "superfaceLanguageClient.commands.outline.refresh",
"when": "view == superfaceOutline",
"group": "navigation"
}
]
}
]
}
}
Loading

0 comments on commit c79debd

Please sign in to comment.