Skip to content

feat: Add Aiken language server support for Cardano smart contracts - #547

Closed
BurgessTG wants to merge 1 commit into
devfrom
unknown repository
Closed

BurgessTG wants to merge 1 commit into
devfrom
unknown repository

Conversation

@BurgessTG

Copy link
Copy Markdown

Summary

Add Aiken language server support to enable intelligent code assistance for Cardano smart contract development.

Features Added

  • Auto-detection: Automatically detects .ak files and starts Aiken LSP
  • Auto-installation: Installs aikup and then aiken if not present via npm
  • Full LSP capabilities: Real-time diagnostics, code completion, hover information, and error checking
  • Documentation: Updated LSP configuration docs with Aiken examples

How it works

  1. When opencode encounters .ak files, it automatically starts the Aiken LSP server
  2. If aiken is not installed, it installs aikup (the Aiken version manager) via npm
  3. Then uses aikup to install the latest Aiken version
  4. Starts the language server with aiken lsp command
  5. Provides full LSP integration for better code assistance

Benefits for Cardano developers

  • Catch errors early before deployment (saves money on blockchain!)
  • Smart code completion for Aiken functions and types
  • Better development experience with instant feedback
  • Seamless integration - just open .ak files and it works

Test plan

  • Verify Aiken LSP starts automatically for .ak files
  • Test automatic installation of aikup and aiken
  • Confirm TypeScript compilation passes
  • Validate LSP integration follows existing patterns (TypeScript, Go, Ruby)

🤖 Generated with opencode

@thdxr

thdxr commented Jun 30, 2025

Copy link
Copy Markdown
Member

you don't need npm! opencode itself has the functionality to run any npm package - check how we do the typescript server should work the same

@BurgessTG

Copy link
Copy Markdown
Author

Thank you for the feedback @thdxr! You're absolutely right - I've updated the implementation to use OpenCode's built-in npm package execution functionality.

Changes Made:

The Aiken LSP now uses the same pattern as the TypeScript server:

export const Aiken: Info = {
  id: "aiken",
  extensions: [".ak"],
  async spawn() {
    // Simply use bun x to run aiken lsp, just like TypeScript
    const proc = spawn(
      BunProc.which(),
      ["x", "@aiken-lang/aiken", "lsp"],
      {
        env: {
          ...process.env,
          BUN_BE_BUN: "1",
        },
      },
    )
    return {
      process: proc,
    }
  },
}

This approach:

  • ✅ No global npm installations
  • ✅ Uses OpenCode's existing infrastructure
  • ✅ Matches the TypeScript server pattern exactly
  • ✅ Simpler and cleaner implementation

The PR has been updated with this improved implementation. Thanks for pointing me in the right direction!

- Uses OpenCode's bun x pattern for package execution
- No global installations required
- Supports .ak files for Cardano smart contract development
- Follows same pattern as TypeScript and Pyright servers
@thdxr thdxr self-assigned this Jul 2, 2025
@BurgessTG BurgessTG closed this Jul 16, 2025
andreipromarketing-dev pushed a commit to andreipromarketing-dev/opencode that referenced this pull request Apr 7, 2026
…s unset (anomalyco#547) (anomalyco#691)

When ECC is installed as a Claude Code plugin via the marketplace,
scripts live in the plugin cache (~/.claude/plugins/cache/...) but
commands fallback to ~/.claude/ which doesn't have the scripts.

Add resolve-ecc-root.js with a 3-step fallback chain:
  1. CLAUDE_PLUGIN_ROOT env var (existing)
  2. Standard install at ~/.claude/ (existing)
  3. NEW: auto-scan the plugin cache directory

Update sessions.md and skill-health.md commands to use the new
inline resolver. Includes 15 tests covering all fallback paths
including env var priority, standard install, cache discovery,
and the compact INLINE_RESOLVE used in command .md files.
bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants