BeyondCodeBootcamp / BeyondCodeBootcamp/vim-ale-hello-world

VimScript & Plugin Notes

Offen
#7 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Shell
Sterne
1
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Just putting these somewhere so I don't lose them.

# vimscript 101

```text
' string
['a', 'b'] list
{ 'key': 'value' } map
" comment
\ escape previous newline+whitespace
# filepath
TitleCase function name
```

# How to add a fixer?

DO NOT use hyphens in the file name!! `ajscript_fmt.vim` vs `ajscript-fmt.vim`

See

`autoload/ale/fix/registry.vim`

```vim
# 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.'
\)
```

```text
\ 'ajscript-fmt': {
\ 'function': 'ale#fixers#ajscript_fmt#Fix',
\ 'suggested_filetypes': ['javascript', 'ajscript'],
\ 'description': 'Apply AJScript format to a file.',
\ },
```

```text
" 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)
```

```vim
function! ale#fixers#ajscript_fmt#GetCwd(buffer) abort
let l:config = ale#path#FindNearestFile(a:buffer, '.ajscript.json')

" Fall back to the directory of the buffer
return !empty(l:config) ? fnamemodify(l:config, ':h') : '%s:h'
endfunction
```

# LSP Server

```vim
call ale#linter#Define('filetype_here', {
\ 'name': 'any_name_you_want',
\ 'lsp': 'socket',
\ 'address': 'servername:1234',
\ 'project_root': '/path/to/root_of_project',
\})
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Überprüfe die VimScript-Notizen in issue #7, den referenzierten Pfad autoload/ale/fix/registry.vim und den verlinkten ALE-Pull-Request. Kläre vor der Bearbeitung, wo diese Notizen abgelegt werden sollten und welches Material im Umfang liegt; im Issue wird derzeit weder eine Dokumentationsdatei noch ein Abschlusskriterium genannt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
vim
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.