Commit 449673d
authored
make lsp-java-format-tab-size compatible with java-ts-mode (#456)
fix#447, fix#451
Currently `lsp-java-format-tab-size` is `c-basic-offset`. By default
c-basic-offset is a special value `set-from-style. When java-mode starts it will
get set c-basic-offset to a number such as 4 or 2.
java-ts-mode won't do anything with c-basic-offset. So lsp will fail to generate
the initializationOptions json because tabSize is set-from-style.
This MR turn lsp-java-format-tab-size to a function to return correct indent
setting depending whether java-ts-mode is on or not.
This s a fancy solution. A simple and fool proof one can be a number value
```elisp
(lsp-defcustom lsp-java-format-tab-size 4
"The basic offset"
:type 'number
:lsp-path "java.format.tabSize")
```1 parent bc89297 commit 449673d
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
389 | 391 | | |
390 | | - | |
| 392 | + | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| |||
0 commit comments