Skip to content

lukeribchester/pact-intellij

Repository files navigation

Kadena logo

Pact Language Support for JetBrains IDEs πŸš€

Build Version Downloads

This plugin provides support for Kadena's Pact smart contract language to the IntelliJ Platform.

Warning: While effort is made to ensure a stable and reliable user experience, this plugin is under heavy development and includes features based on the experimental IntelliJ Platform Language Server API.

What is Kadena?

Kadena is the industry’s only truly scalable Layer-1 Proof-of-Work blockchain. More to the point, it’s the only blockchain scalable enough to fully replace the global financial system β€” and other legacy centralized systems β€” without compromising on speed or security.

With Chainweb, Kadena’s multi-braided, infinitely scalable blockchain technology, and Pact, our industry-leading smart contract language, Kadena transcends the limits of conventional Layer-1 and Layer-2 blockchains, enabling builders to create meaningful solutions to real-world problems.

In other words, Kadena is operating on a whole other layer: Layer H, the Human Layer.

What is Pact? 🀝

Pact is a human-readable smart contract language. It allows anyone to write clearly, directly and safely onto a blockchain β€” a true innovation for secure and simple smart contract development. Pact will enable you to create entirely new business models and on-chain services.

What is a smart contract? πŸ“‘

Smart contracts are like regular, paper contracts, except that their terms are enforced by computer code, instead of humans. Imagine if a baseball player received an automatic bonus in his next paycheck because he hit a certain number of home runs.

Smart contracts are the next generation of legal contracts. And Pact is the next generation of smart contracts.

Features

Pact Language Server (LSP)

  • Error highlighting
  • Code completion
  • Documentation

Please refer to the documentation for a full list of supported features.

Note: Support for Language Server Protocol features on the IntelliJ Platform is currently experimental.

Native (IntelliJ Platform)

  • Syntax highlighting
  • Error highlighting
  • Code assistance
  • Run configurations

Roadmap

Please refer to the project overview for a full list of planned features.


Requirements βœ…

Pact 4

1. Pact Interpreter

Install Pact 4 by downloading a prebuilt binary or by building from source.

Tip

The easiest way to install Pact 4 on macOS is by using the Homebrew package manager. With Homebrew installed, run the following commands:

brew update
brew install kadena-io/pact/pact

2. Pact Language Server (LSP)

The latest Pact 4 Language Server releases for macOS, Linux, and Windows are included with this plugin.

Alternatively you can install a different version by downloading a prebuilt binary or by building from source.

Pact 5 (Alpha)

1. Pact Interpreter

Install Pact 5 by downloading a prebuilt binary or by building from source.

Tip

The easiest way to install Pact 5 on macOS or Linux is by using the Pactup version manager. With Node installed, run the following commands:

npx pactup install development-latest
npx pactup which development-latest

2. Pact Language Server (LSP)

The Pact 5 interpreter contains an integrated language server, therefore separate installation is not required.

Installation πŸ’Ώ

JetBrains Marketplace

Install using your IDE's built-in plugin marketplace:

  1. Navigate to Settings/Preferences
  2. Select Plugins > Marketplace
  3. Search for 'Pact'
  4. Select Install Plugin

View on the JetBrains Marketplace.

Manual

Download the latest release and install it manually from disk through your IDE:

  1. Navigate to Settings/Preferences
  2. Select Plugins > βš™οΈ > Install Plugin from Disk...
  3. Open the downloaded .zip file

Configuration βš™οΈ

Configuration is required to enable functionality from the Pact language server:

  1. Navigate to Settings/Preferences
  2. Select Languages & Frameworks > Pact
  3. Specify your Pact interpreter and Pact language server paths

Pactup

If you installed Pact 5 via Pactup then run the following command to retrieve the path of the interpreter and integrated language server:

npx pactup which development-latest

Homebrew

If you installed Pact 4 via Homebrew then run the following command to retrieve the path of the interpreter:

brew info pact