All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#fix#registry#Clear()
4 let g:buffer = bufnr('')
6 function GetSuggestions()
9 if bufnr('') != g:buffer
10 let l:lines = getline(1, '$')
19 if bufnr('') != g:buffer
25 call ale#fix#registry#ResetToDefaults()
26 delfunction GetSuggestions
28 Execute(ALEFixSuggest should return something sensible with no suggestions):
31 \ 'There is nothing in the registry to suggest.',
33 \ 'Press q to close this window',
37 Execute(ALEFixSuggest should set the appropriate settings):
40 AssertEqual 'ale-fix-suggest', &filetype
41 Assert !&modified, 'The buffer was marked as modified'
42 Assert !&modifiable, 'The buffer was modifiable'
44 Execute(ALEFixSuggest output should be correct for only generic handlers):
45 call ale#fix#registry#Add('zed', 'XYZ', [], 'Zedify things.')
46 call ale#fix#registry#Add('alpha', 'XYZ', [], 'Alpha things.')
50 \ 'Try the following generic fixers:',
52 \ '''alpha'' - Alpha things.',
53 \ '''zed'' - Zedify things.',
55 \ 'See :help ale-fix-configuration',
57 \ 'Press q to close this window',
61 Execute(ALEFixSuggest output should be correct for only filetype handlers):
62 let &filetype = 'testft2.testft'
64 call ale#fix#registry#Add('zed', 'XYZ', ['testft2'], 'Zedify things.')
65 call ale#fix#registry#Add('alpha', 'XYZ', ['testft'], 'Alpha things.')
69 \ 'Try the following fixers appropriate for the filetype:',
71 \ '''alpha'' - Alpha things.',
72 \ '''zed'' - Zedify things.',
74 \ 'See :help ale-fix-configuration',
76 \ 'Press q to close this window',
80 Execute(ALEFixSuggest should suggest filetype and generic handlers):
81 let &filetype = 'testft2.testft'
83 call ale#fix#registry#Add('zed', 'XYZ', ['testft2'], 'Zedify things.', ['foobar'])
84 call ale#fix#registry#Add('alpha', 'XYZ', ['testft'], 'Alpha things.')
85 call ale#fix#registry#Add('generic', 'XYZ', [], 'Generic things.')
89 \ 'Try the following fixers appropriate for the filetype:',
91 \ '''alpha'' - Alpha things.',
92 \ '''zed'', ''foobar'' - Zedify things.',
94 \ 'Try the following generic fixers:',
96 \ '''generic'' - Generic things.',
98 \ 'See :help ale-fix-configuration',
100 \ 'Press q to close this window',