A CodeMirror extension that provides Solidity syntax highlighting and language support.
Usageimport { basicSetup } from 'codemirror'; import { EditorView } from '@codemirror/view'; import { EditorState } from '@codemirror/state'; import { solidity } from '@replit/codemirror-lang-solidity'; const doc = ` pragma solidity ^0.8.10; contract EtherWallet { address payable public owner; constructor() { owner = payable(msg.sender); } receive() external payable {} function withdraw(uint _amount) external { require(msg.sender == owner, "caller is not owner"); payable(msg.sender).transfer(_amount); } function getBalance() external view returns (uint) { return address(this).balance; } } ` new EditorView({ state: EditorState.create({ doc, extensions: [ basicSetup, solidity, ], }), parent: document.querySelector('#editor'), });Readme Keywordsnone Package Sidebar Install
npm i @replit/codemirror-lang-solidity
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4