Skip to content

Commit e36a3d4

Browse files
committed
cleanup!: drop support for nvim 0.8
1 parent 7f3a9ee commit e36a3d4

File tree

7 files changed

+8
-16
lines changed

7 files changed

+8
-16
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
strategy:
5151
matrix:
5252
include:
53-
- nvim_tag: v0.8.3
5453
- nvim_tag: v0.9.4
5554
- nvim_tag: v0.10.0
5655

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Lightweight yet powerful formatter plugin for Neovim
2727

2828
## Requirements
2929

30-
- Neovim 0.8+
30+
- Neovim 0.9+ (for older versions, use a [nvim-0.x branch](https://github.com/stevearc/conform.nvim/branches))
3131

3232
## Features
3333

@@ -216,7 +216,7 @@ You can view this list in vim with `:help conform-formatters`
216216
- [darker](https://github.com/akaihola/darker) - Run black only on changed lines.
217217
- [dart_format](https://dart.dev/tools/dart-format) - Replace the whitespace in your program with formatting that follows Dart guidelines.
218218
- [dcm_fix](https://dcm.dev/docs/cli/formatting/fix/) - Fixes issues produced by dcm analyze, dcm check-unused-code or dcm check-dependencies commands.
219-
- [dcm_format](https://dcm.dev/docs/cli/formatting/format/) - Formats *.dart files.
219+
- [dcm_format](https://dcm.dev/docs/cli/formatting/format/) - Formats .dart files.
220220
- [deno_fmt](https://deno.land/manual/tools/formatter) - Use [Deno](https://deno.land/) to format TypeScript, JavaScript/JSON and markdown.
221221
- [dfmt](https://github.com/dlang-community/dfmt) - Formatter for D source code.
222222
- [djlint](https://github.com/Riverside-Healthcare/djLint) - ✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang.

doc/conform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ FORMATTERS *conform-formatter
301301
follows Dart guidelines.
302302
`dcm_fix` - Fixes issues produced by dcm analyze, dcm check-unused-code or dcm
303303
check-dependencies commands.
304-
`dcm_format` - Formats *.dart files.
304+
`dcm_format` - Formats .dart files.
305305
`deno_fmt` - Use [Deno](https://deno.land/) to format TypeScript,
306306
JavaScript/JSON and markdown.
307307
`dfmt` - Formatter for D source code.

lua/conform/formatters/dcm_format.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
return {
33
meta = {
44
url = "https://dcm.dev/docs/cli/formatting/format/",
5-
description = "Formats *.dart files.",
5+
description = "Formats .dart files.",
66
},
77
command = "dcm",
88
args = { "format", "$FILENAME" },

lua/conform/formatters/injected.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,6 @@ return {
136136
-- (defaults to the value from formatters_by_ft)
137137
lang_to_formatters = {},
138138
},
139-
condition = function(self, ctx)
140-
local ok, parser = pcall(vim.treesitter.get_parser, ctx.buf)
141-
-- Require Neovim 0.9 because the treesitter API has changed significantly
142-
---@diagnostic disable-next-line: invisible
143-
return ok and parser._injection_query and vim.fn.has("nvim-0.9") == 1
144-
end,
145139
format = function(self, ctx, lines, callback)
146140
local conform = require("conform")
147141
local errors = require("conform.errors")

lua/conform/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ end
5252

5353
---@param opts? conform.setupOpts
5454
M.setup = function(opts)
55+
if vim.fn.has("nvim-0.9") == 0 then
56+
notify("conform.nvim requires Neovim 0.9+", vim.log.levels.ERROR)
57+
return
58+
end
5559
opts = opts or {}
5660

5761
M.formatters = vim.tbl_extend("force", M.formatters, opts.formatters or {})

tests/injected_spec.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ local injected = require("conform.formatters.injected")
44
local runner = require("conform.runner")
55
local test_util = require("tests.test_util")
66

7-
-- injected formatter only supported on neovim 0.9+
8-
if vim.fn.has("nvim-0.9") == 0 then
9-
return
10-
end
11-
127
---@param dir string
138
---@return string[]
149
local function list_test_files(dir)

0 commit comments

Comments
 (0)