Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# client executables files
node_modules/
out/

.pnpm-debug.log

*.ast
dist/

# vscode package
*.vsix

# lock files
Cargo.lock
**/pnpm-lock.yaml
5 changes: 4 additions & 1 deletion vscode/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ node_modules/
.git/
.gitignore
npm-debug.log
*.ts
**/*.ts
*.map
tsconfig.json
.github
test/
tests/
README.md
esbuild.js
bitcoind-tests/
flake.*
Cargo.*
10 changes: 10 additions & 0 deletions vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ SimplicityHL is a high-level language for writing Simplicity smart contracts. Si
- Syntax highlighting for .simf and .wit files
- Basic language configuration (brackets, comments)

Also, you can install the [SimplicityHL language server](https://github.com/distributed-lab/simplicityhl-lsp), which enables several features:
- Error diagnostics
![diagnostics](https://github.com/user-attachments/assets/54315645-464b-40c3-bb72-c6e8c4bc0ad5)

- Completion of user-defined functions and jets
![completion](https://github.com/user-attachments/assets/bbc2b9de-c286-4d31-b47e-ac95885f8916)




### Development

To install the extension manually or hack on the source code see [development.md](docs/development.md)
57 changes: 57 additions & 0 deletions vscode/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const esbuild = require("esbuild");

const production = process.argv.includes("--production");
const watch = process.argv.includes("--watch");

async function main() {
const ctx = await esbuild.context({
entryPoints: ["src/extension.ts"],
bundle: true,
format: "cjs",
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: "node",
outfile: "dist/extension.js",
external: ["vscode"],
logLevel: "warning",
plugins: [
/* add to the end of plugins array */
esbuildProblemMatcherPlugin,
],
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}

/**
* @type {import('esbuild').Plugin}
*/
const esbuildProblemMatcherPlugin = {
name: "esbuild-problem-matcher",

setup(build) {
build.onStart(() => {
console.log("[watch] build started");
});
build.onEnd((result) => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`);
if (location == null) return;
console.error(
` ${location.file}:${location.line}:${location.column}:`,
);
});
console.log("[watch] build finished");
});
},
};

main().catch((e) => {
console.error(e);
process.exit(1);
});
Loading