Omni completion for items without documentation
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- vim
- Bereich
- tooling
Rechercherichtung
Beginne in autoload/rescript.vim ungefähr bei Zeile 369 und baue das Projekt, bevor du den Vervollständigungsfall aus dem Issue in Vim oder Neovim reproduzierst. Überprüfe die Behandlung von item.documentation, wenn der Wert null ist, unter Berücksichtigung der Behebung der Vervollständigungsabweichung in #56. Als erledigt gilt die Aufgabe, wenn integrierte und nicht dokumentierte lokale Elemente ohne die gemeldeten Fehler vervollständigt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Under the hood, rescript-editor-analysis.exe returns null instead of an object/dict when a completion item has no documentation. This results in multiple errors in rescript#Complete.
A minimal example with vim-plug and the latest versions of vim-rescript and rescript (tested in VIM 8.2 and in Neovim 0.6.1):
~/.vimrc or ~/.config/nvim/init.vim:
call plug#begin()
Plug 'rescript-lang/vim-rescript'
call plug#end()
set omnifunc=rescript#Complete
set completeopt+=preview
Example.res:
let myInteger = 1
let myString = "2"
Also needed:
- complete/completion mismatch fix: #56
Make sure the project is built. Type let my as the last line of Example.res and hit <C-x><C-o> in insert mode. You'll get the following errors twice:
Error detected while processing function rescript#Complete:
line 36:
E121: Undefined variable: value
Press ENTER or type command to continue
Error detected while processing function rescript#Complete:
line 38:
E121: Undefined variable: entry
Press ENTER or type command to continue
Error detected while processing function rescript#Complete:
line 38:
E116: Invalid arguments for function add(l:ret, entry)
Press ENTER or type command to continue
After hitting ENTER enough times:
-- Omni completion (^O^N^P) Pattern not found
I think the problem lies here:
item.documentation is null for undocumented matches.
I tried to replace the offending line with the following, and now omni completion works both for built-in items and for undocumented local items (but I'm no expert in vimscript, so this may be a silly way to do it):
if type(item.documentation) == v:t_dict
let l:info = item.documentation.value
else
let l:info = item.detail " or some default value
endif
let entry = { 'word': item.label, 'kind': l:kind, 'info': l:info }
- Vorherrschende Sprache
- Vim Script
- Sterne
- 164
- Forks
- 17
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rescript-lang/vim-rescript
-
Add errorformat Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
rescript-lang/vim-rescript#74 · 1 Kommentar ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
rescript-lang/vim-rescript#67 · 1 Kommentar ·
-
Create interface files Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 30/100
rescript-lang/vim-rescript#66 · 1 Kommentar ·
-
Incorrect resource paths Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Alle Issues in rescript-lang/vim-rescript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
use-agent-os/agent-os#3314 ·
-
documentation low-priority templates
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
jesseray718/openroot#87 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
danielmiessler/LifeOS#2218 ·
-
in-progress proposal
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
uibcdf/molsyssuite#36 ·