Skip to content

feat(lang): add solidity language support#4742

Merged
folke merged 4 commits intoLazyVim:mainfrom
r0k1s-i:add-solidity-support
Oct 20, 2025
Merged

feat(lang): add solidity language support#4742
folke merged 4 commits intoLazyVim:mainfrom
r0k1s-i:add-solidity-support

Conversation

@r0k1s-i
Copy link
Contributor

@r0k1s-i r0k1s-i commented Nov 9, 2024

Description

Summary

This PR adds comprehensive support for Solidity development in Neovim using LazyVim. The following updates were made to streamline Solidity development:

Changes

  1. Solidity File Type Detection
    • Configured LazyVim to recognize Solidity projects by detecting foundry.toml, hardhat.config.js, and hardhat.config.ts files.
  2. Treesitter Support for Solidity
    • Added solidity to the list of languages ensured by nvim-treesitter, providing syntax highlighting and better code structure understanding.
  3. Language Server Protocol (LSP) Setup
    • Configured nvim-lspconfig to support solidity_ls as the LSP for Solidity files.
    • Set up root_dir detection based on project files or a .git directory to enable proper LSP functioning in Solidity projects.
  4. Solidity Formatter
    • Integrated forge_fmt as a formatter for Solidity files using conform.nvim, which utilizes forge fmt to format code.

Why use forge fmt instead of Prettier?

  • Prettier's Solidity support requires extra plugins: Prettier does not have native Solidity support and depends on prettier-plugin-solidity. Even with vim.g.lazyvim_prettier_needs_config = false, formatting won't work unless a .prettierrc file is configured, creating unnecessary complexity.
  • forge fmt is the native tool for Solidity development: Forge is a widely used tool within the Solidity ecosystem, especially when working with Foundry. It provides built-in formatting with no extra dependencies, making it simpler and more efficient to integrate.
  • Hardhat uses prettier-plugin-solidity: For users of Hardhat, prettier-plugin-solidity is required for code formatting. However, the integration with Prettier might add complexity, while forge fmt simplifies the process.
  • Future customization: We may allow users to choose between prettier-plugin-solidity and forge fmt for formatting in the future, depending on their preferred tools.

Testing

  • Confirmed that Solidity files are detected and syntax-highlighted by Treesitter.
  • Verified LSP functionality for Solidity, including code navigation and error detection.
  • Tested forge_fmt for automatic code formatting on Solidity files.

Motivation

These changes provide a smoother and more robust Solidity development experience in Lazyvim, including syntax highlighting, code navigation, and automatic formatting.

Related Issue(s)

#1901

Checklist

 ## Description

- Add Solidity language support to `nvim-treesitter` for syntax highlighting and enhanced code understanding.
- Configure `nvim-lspconfig` for Solidity LSP support, setting up `solidity_ls` with a root pattern detection for Solidity projects.
- Integrate `forge_fmt` as the formatter for Solidity files using `conform.nvim`, with command options for `forge fmt`.
@Conarius
Copy link
Contributor

Conarius commented Nov 9, 2024

There's also a neotest adapter for solidity/hardhat

@r0k1s-i
Copy link
Contributor Author

r0k1s-i commented Nov 9, 2024

also a neotest adapter for solidity/hardhat

I noticed that these adapters are not maintained frequently and have few users, so I didn't include them.

@github-actions
Copy link
Contributor

This PR is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the stale This issue or PR has been inactive for a while label Dec 10, 2024
@johnrommeloctaviano
Copy link

Needed this feature as well

@github-actions github-actions bot removed the stale This issue or PR has been inactive for a while label Oct 9, 2025
@folke folke added the size/m Medium PR (<50 lines changed) label Oct 19, 2025
@folke folke merged commit 2cd46d4 into LazyVim:main Oct 20, 2025
5 of 6 checks passed
folke pushed a commit that referenced this pull request Oct 20, 2025
🤖 I have created a release *beep* *boop*
---


##
[15.10.0](v15.9.0...v15.10.0)
(2025-10-20)


### Features

* **ai:** add avante.nvim for a better AI experience
([#4440](#4440))
([2682ce0](2682ce0))
* **extra:** allow users to add custom bundles through
opts.init_options.bundles to jdtls
([#6265](#6265))
([faeb24b](faeb24b))
* **extras:** add Dart language
([#4749](#4749))
([90f84e7](90f84e7))
* **extras:** added ember lang support
([#6203](#6203))
([ac4cce0](ac4cce0))
* **extras:** added twig language
([#5464](#5464))
([a6eb51e](a6eb51e))
* **extras:** ai: add `claudecode.nvim`
([#6229](#6229))
([e7a3e80](e7a3e80))
* **extras:** automatically update lazyvim.json for renamed or
deprecated extras
([37ecd06](37ecd06))
* **extras:** renamed extra omnisharp -&gt; dotnet + added fautocomplete
to lspconfig
([1b2e6e8](1b2e6e8))
* **extras:** utils: add `gh.nvim`
([#6250](#6250))
([8db9c75](8db9c75))
* **go:** add linting with golangci-lint
([#6311](#6311))
([248876a](248876a))
* **haskell:** update `haskell-tools` version and add formatters +
linters ([#6230](#6230))
([82382f4](82382f4))
* **lang/fsharp:** add F# support to omnisharp extra
([#6538](#6538))
([80a980a](80a980a))
* **lang:** add neotest config for PHP tests
([#5958](#5958))
([9b077c7](9b077c7))
* **lang:** add solidity language support
([#4742](#4742))
([2cd46d4](2cd46d4))
* **lang:** add Typst language support
([#4042](#4042))
([645846b](645846b))
* **lang:** julia support
([#6231](#6231))
([5d186c0](5d186c0))
* **lang:** nix add `statix` linter
([#6244](#6244))
([2a866f6](2a866f6))
* **sidekick:** added sidekick cli status to lualine
([16917db](16917db))


### Bug Fixes

* **extras.lang:** fix Scala extra by using nvimMetals only
([#5726](#5726))
([f118dca](f118dca))
* **fzf-lua:** added some missing keymaps similar to snacks picker.
Closes [#6036](#6036). Closes
[#5830](#5830)
([69a5744](69a5744))
* **helm:** broken helm highlighting
([#5335](#5335))
([4d0d87f](4d0d87f))
* **keymap:** remove select mode remaps of printable characters
([#6296](#6296))
([83468be](83468be))
* **tailwind:** additional settings
([#5266](#5266))
([d2f9885](d2f9885))
* **telescope:** sync keymaps with snacks picker + added some that were
missing
([1a08e9f](1a08e9f))
* **twig:** correct mason url
([9d345de](9d345de))
* **typescript:** better default pwa-node DAP config. Closes
[#6386](#6386)
([e4d3432](e4d3432))
* **typescript:** support chrome, node and msedge dap adapters
([#6649](#6649))
([0b65d33](0b65d33))
* **util.project:** different mapping on dashboard than
`snacks.projects`
([#5737](#5737))
([e389447](e389447))


### Reverts

* "feat(extra): allow users to add custom bundles through
opts.init_options.bundles to jdtls
([#6265](#6265))"
([#6650](#6650))
([a582f00](a582f00))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
NanoBoom pushed a commit to NanoBoom/LazyVim that referenced this pull request Oct 21, 2025
🤖 I have created a release *beep* *boop*
---


##
[15.10.0](LazyVim/LazyVim@v15.9.0...v15.10.0)
(2025-10-20)


### Features

* **ai:** add avante.nvim for a better AI experience
([#4440](LazyVim/LazyVim#4440))
([2682ce0](LazyVim/LazyVim@2682ce0))
* **extra:** allow users to add custom bundles through
opts.init_options.bundles to jdtls
([#6265](LazyVim/LazyVim#6265))
([faeb24b](LazyVim/LazyVim@faeb24b))
* **extras:** add Dart language
([#4749](LazyVim/LazyVim#4749))
([90f84e7](LazyVim/LazyVim@90f84e7))
* **extras:** added ember lang support
([#6203](LazyVim/LazyVim#6203))
([ac4cce0](LazyVim/LazyVim@ac4cce0))
* **extras:** added twig language
([#5464](LazyVim/LazyVim#5464))
([a6eb51e](LazyVim/LazyVim@a6eb51e))
* **extras:** ai: add `claudecode.nvim`
([#6229](LazyVim/LazyVim#6229))
([e7a3e80](LazyVim/LazyVim@e7a3e80))
* **extras:** automatically update lazyvim.json for renamed or
deprecated extras
([37ecd06](LazyVim/LazyVim@37ecd06))
* **extras:** renamed extra omnisharp -&gt; dotnet + added fautocomplete
to lspconfig
([1b2e6e8](LazyVim/LazyVim@1b2e6e8))
* **extras:** utils: add `gh.nvim`
([#6250](LazyVim/LazyVim#6250))
([8db9c75](LazyVim/LazyVim@8db9c75))
* **go:** add linting with golangci-lint
([#6311](LazyVim/LazyVim#6311))
([248876a](LazyVim/LazyVim@248876a))
* **haskell:** update `haskell-tools` version and add formatters +
linters ([#6230](LazyVim/LazyVim#6230))
([82382f4](LazyVim/LazyVim@82382f4))
* **lang/fsharp:** add F# support to omnisharp extra
([#6538](LazyVim/LazyVim#6538))
([80a980a](LazyVim/LazyVim@80a980a))
* **lang:** add neotest config for PHP tests
([#5958](LazyVim/LazyVim#5958))
([9b077c7](LazyVim/LazyVim@9b077c7))
* **lang:** add solidity language support
([#4742](LazyVim/LazyVim#4742))
([2cd46d4](LazyVim/LazyVim@2cd46d4))
* **lang:** add Typst language support
([#4042](LazyVim/LazyVim#4042))
([645846b](LazyVim/LazyVim@645846b))
* **lang:** julia support
([#6231](LazyVim/LazyVim#6231))
([5d186c0](LazyVim/LazyVim@5d186c0))
* **lang:** nix add `statix` linter
([#6244](LazyVim/LazyVim#6244))
([2a866f6](LazyVim/LazyVim@2a866f6))
* **sidekick:** added sidekick cli status to lualine
([16917db](LazyVim/LazyVim@16917db))


### Bug Fixes

* **extras.lang:** fix Scala extra by using nvimMetals only
([#5726](LazyVim/LazyVim#5726))
([f118dca](LazyVim/LazyVim@f118dca))
* **fzf-lua:** added some missing keymaps similar to snacks picker.
Closes [#6036](LazyVim/LazyVim#6036). Closes
[#5830](LazyVim/LazyVim#5830)
([69a5744](LazyVim/LazyVim@69a5744))
* **helm:** broken helm highlighting
([#5335](LazyVim/LazyVim#5335))
([4d0d87f](LazyVim/LazyVim@4d0d87f))
* **keymap:** remove select mode remaps of printable characters
([#6296](LazyVim/LazyVim#6296))
([83468be](LazyVim/LazyVim@83468be))
* **tailwind:** additional settings
([#5266](LazyVim/LazyVim#5266))
([d2f9885](LazyVim/LazyVim@d2f9885))
* **telescope:** sync keymaps with snacks picker + added some that were
missing
([1a08e9f](LazyVim/LazyVim@1a08e9f))
* **twig:** correct mason url
([9d345de](LazyVim/LazyVim@9d345de))
* **typescript:** better default pwa-node DAP config. Closes
[#6386](LazyVim/LazyVim#6386)
([e4d3432](LazyVim/LazyVim@e4d3432))
* **typescript:** support chrome, node and msedge dap adapters
([#6649](LazyVim/LazyVim#6649))
([0b65d33](LazyVim/LazyVim@0b65d33))
* **util.project:** different mapping on dashboard than
`snacks.projects`
([#5737](LazyVim/LazyVim#5737))
([e389447](LazyVim/LazyVim@e389447))


### Reverts

* "feat(extra): allow users to add custom bundles through
opts.init_options.bundles to jdtls
([#6265](LazyVim/LazyVim#6265))"
([#6650](LazyVim/LazyVim#6650))
([a582f00](LazyVim/LazyVim@a582f00))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extras extras-lang size/m Medium PR (<50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants