You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# ale#fix#registry#Add(name, func, filetypes, desc, ...)
ale#fix#registry#Add(
\ 'ajscript-fmt',
\ 'ale#fixers#ajscript_fmt#Fix',
\ ['javascript', 'ajscript'],
\ 'Apply AJScript format to a file.'\)
\ 'ajscript-fmt': {
\ 'function': 'ale#fixers#ajscript_fmt#Fix',
\ 'suggested_filetypes': ['javascript', 'ajscript'],
\ 'description': 'Apply AJScript format to a file.',
\ },
" g: global var
" a: function argument
" b: ?? variable
" l: function-local variable
" %t means current filename (says gpt)
" :h means dirname (head)
" :t means filename (tail)
function!ale#fixers#ajscript_fmt#GetCwd(buffer) abortletl:config=ale#path#FindNearestFile(a:buffer, '.ajscript.json')
" Fall back to the directory of the bufferreturn!empty(l:config) ? fnamemodify(l:config, ':h') : '%s:h'endfunction
Just putting these somewhere so I don't lose them.
vimscript 101
How to add a fixer?
DO NOT use hyphens in the file name!!
ajscript_fmt.vim
vsajscript-fmt.vim
See https://github.com/dense-analysis/ale/pull/4427/files
autoload/ale/fix/registry.vim
LSP Server
https://www.toptal.com/javascript/language-server-protocol-tutorial
The text was updated successfully, but these errors were encountered: