Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ssmolkin1/company-solidity
Company mode back-end for solidity
https://github.com/ssmolkin1/company-solidity
Last synced: about 5 hours ago
JSON representation
Company mode back-end for solidity
- Host: GitHub
- URL: https://github.com/ssmolkin1/company-solidity
- Owner: ssmolkin1
- License: gpl-3.0
- Created: 2018-01-29T16:12:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-07T20:50:56.000Z (over 6 years ago)
- Last Synced: 2024-08-01T21:47:33.753Z (3 months ago)
- Language: Emacs Lisp
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-solidity - company-solidity - Autocomplete with company-mode. (Editor Plugins)
- awesome-solidity - company-solidity - Autocomplete with company-mode. (Editor Plugins)
- awesome-solidity - company-solidity - Autocomplete with company-mode. (Editor Plugins)
README
# company-solidity
## Now fully integrated in solidity-mode, no longer independently maintained
`company-solidity` is now fully integrated in `solidity-mode`, and will be installed automatically alongside it when you install (or upgrade) that package, and will be enabled automatically for users who have `company-mode` installed. Thus, you no longer need to, nor should you, install `company-solidity` as a stand-alone package. This repo will continue to be hosted, but will no longer be updated going forward.## Upgrade to version 2.0.0
`company-solidity` has now been updated to:
- pull completion targets from `solidity-mode` syntax highlighting keyword lists, for greater maintainability; and
- add more completion targets which are new or were missing from previous versions (on top of the `solidity-mode` keyword lists).Becuase of the first change above, `company-solidity` now requires `solidity-mode`.
## Overview
This is a simple company-mode back-end for autocompletion for the Solidity programming langauge. It is intended to be used with [solidity-mode](https://github.com/ethereum/emacs-solidity).### What it does
Give completion suggestions for Solidity keywords, global variables, and address methods.### What it isn't
Smart. The completion suggestions are *not context dependent*.### Something to watch out for
`company-mode` treats `.` as the end of a word, and will cut off compeletion suggestions when you type a `.`. So, when you've typed `msg` you will get `msg.sender`, `msg.value` etc. as completion suggestions. However, as soon as you type `msg.`, the suggestions will disappear.## Installation
First, install the package from MELPA with `M-x package-install RET company-solidity RET`, then put the following in your `init.el`:
```lisp
(require 'company-solidity)
```Alternatively, to install with [use-package](https://github.com/jwiegley/use-package), put the following in your `init.el`:
```lisp
(use-package company-solidity
:ensure t
:after (company))
```That's it. Now open up a file in `solitidy-mode` and try it out!
## Usage
Completion suggestions from the `company-solidity` back-end will automatically appear when `solidity-mode` is your `major-mode`.
## Local Variables
If you want autocomplete suggestions to include local variables, as well as Solidity keywords, add the following to your `init.el`:
```lisp
(add-hook 'solidity-mode-hook
(lambda ()
(set (make-local-variable 'company-backends)
(append '((company-solidity company-capf company-dabbrev-code))
company-backends))))
```