-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeline-provider-ale.txt
147 lines (120 loc) · 3.78 KB
/
feline-provider-ale.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
INTRODUCTION *feline-ale-provider*
Custom provider for displaying ALE status/diagnostics for feline.nvim
SETUP *feline-ale-provider-setup*
Import the ALE provider with the following and check the API doc below
for implementation:
>
local ale = require('feline.custom_providers.ale')
<
PROVIDERS *feline-ale-provider-providers*
Assuming you've imported as `ale` a show in |feline-ale-provider-setup|.
ale.status_provider()
Shows the ALE status for the current buffer. Linters and
fixers that are registered are also show but as an icon.
Options are provided as `opts` to change the following.
text (string): The text to display, default is 'ALE'
linter_icon (string): The icon to display for linter,
default is ''
fixer_icon (string): The icon to display for fixer,
default is ''
Example:
>
local components = {
active = { {}, {}, {} },
}
table.insert(components.active[1], {
provider = {
name = 'ale_status',
opts = {
linter_icon = '',
},
},
})
require('feline').setup({
components = components,
custom_providers = {
ale_status = ale.status_provider,
},
})
<
ale.diagnostic_error_provider()
Shows the number of errors in the current buffer. This
provider only gives you the number, it's up to you on how
you want to style it, check the example lua file in
`examples/feline.lua`.
Example:
>
local components = {
active = { {}, {}, {} },
}
table.insert(components.active[1], {
provider = 'ale_error',
})
require('feline').setup({
components = components,
custom_providers = {
ale_error = ale.diagnostic_error_provider,
},
})
<
ale.diagnostic_warning_provider()
Shows the number of warnings in the current buffer. This
provider only gives you the number, it's up to you on how
you want to style it, check the example lua file in
`examples/feline.lua`.
Example:
>
local components = {
active = { {}, {}, {} },
}
table.insert(components.active[1], {
provider = 'ale_warning',
})
require('feline').setup({
components = components,
custom_providers = {
ale_warning = ale.diagnostic_warning_provider,
},
})
<
ale.diagnostic_info_provider()
Shows the number of infos in the current buffer. This
provider only gives you the number, it's up to you on how
you want to style it, check the example lua file in
`examples/feline.lua`.
Example:
>
local components = {
active = { {}, {}, {} },
}
table.insert(components.active[1], {
provider = 'ale_info',
})
require('feline').setup({
components = components,
custom_providers = {
ale_info = ale.diagnostic_info_provider,
},
})
<
HELPER FUNCTIONS *feline-ale-provider-helpers*
Assuming the lua module was imported as `ale` a show in
|feline-ale-provider-setup|.
ale.is_registered()
Returns a boolean when an ALE linter or fixer has been setup.
Returns: ~
`true` if registered, else `false`.
ale.has_registered_linters()
Returns a boolean when an ALE linter has been setup.
Returns: ~
`true` if registered, else `false`.
ale.has_registered_fixers()
Returns a boolean when an ALE fixer has been setup.
Returns: ~
`true` if registered, else `false`.
ale.get_diagnostic_count({attr})
Returns a count of diagnostic given an scope.
{attr} can be "error", "warning" or "info".
Returns: ~
number
vim:tw=78:ts=8:noet:ft=help:norl: