-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix indentation offset when using Eglot with LSP indentation.
This fix correctly sets `tab-width`, which Eglot uses to specify the indentation offset to the Language Server. `tab-width` needs to be set to `ada-ts-mode-indent-offset` before calling `eglot-format`. It was incorrectly using the default value of `tab-width` instead.
- Loading branch information
Showing
2 changed files
with
3 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
;; Author: Troy Brown <[email protected]> | ||
;; Created: February 2023 | ||
;; Version: 0.7.0 | ||
;; Version: 0.7.1 | ||
;; Keywords: ada languages tree-sitter | ||
;; URL: https://github.com/brownts/ada-ts-mode | ||
;; Package-Requires: ((emacs "29.1")) | ||
|
@@ -690,6 +690,7 @@ formatting function fails." | |
When CLIENT is not nil, use it as the active LSP client." | ||
(if-let* ((client (or client (ada-ts-mode-lspclient-current)))) | ||
(let ((inhibit-message t) | ||
(tab-width ada-ts-mode-indent-offset) | ||
(standard-indent ada-ts-mode-indent-offset)) | ||
(ada-ts-mode-lspclient-format-region client beg end)) | ||
;; fallback on default indentation | ||
|