AstroNvim / AstroNvim/docs

JDTLS example is not quite right

Offen
#128 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug help wanted
Vorherrschende Sprache
MDX
Sterne
30
Forks
72
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Checklist

- [X] I have searched through the AstroNvim docs
- [X] I have searched through the existing issues of AstroNvim
- [X] I have searched the existing issues of plugins related to this issue

### Neovim version (nvim -v)

0.9.4

### Operating system/version

NixOs 23

### Terminal/GUI

Alacritty

### Describe the bug

In the example given in https://docs.astronvim.com/recipes/advanced_lsp/#java-nvim-jdtls a new folder is created every time neovim is executed. And it concatenates the cwd so a new folder will be created by the name of the cwd even if it's not a java project.

```
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
local workspace_dir = vim.fn.stdpath "data" .. "/site/java/workspace-root/" .. project_name

os.execute("mkdir " .. workspace_dir)
```

![image](https://github.com/AstroNvim/docs/assets/18459807/00ef016a-e701-4803-b98f-97e68bb6e8f7)

Additionally, `os.execute` does not work when the shell is `nushell`. Error of that actually visible for 200ms. I had to record and go frame by frame to read the error message. `vim.fn.mkdir()` probably a good alternative.

![image](https://github.com/AstroNvim/docs/assets/18459807/1b4fdefb-bd20-416a-82ee-3262ad27b13e)

### Steps to Reproduce

.

### Expected behavior

.

### Screenshots

_No response_

### Additional Context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Java-nvim-jdtls-Beispiel in docs/recipes/advanced_lsp. Überprüfe die Einrichtung des Workspace-Verzeichnisses und führe es aus einem Nicht-Java-Projekt sowie mit nushell aus; als abgeschlossen gilt die Aufgabe, wenn das Beispiel beim Start keine unnötigen Ordner mehr erstellt und die Verzeichniserstellung mit dieser Shell funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua, neovim
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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