-
Notifications
You must be signed in to change notification settings - Fork 109
Add support for Nix, Typst, and Vhdl #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -238,6 +238,7 @@ This hook will be run even when there are no matching sections in | |
| (meson-mode meson-indent-basic) | ||
| (mips-mode mips-tab-width) | ||
| (mustache-mode mustache-basic-offset) | ||
| (nix-ts-mode nix-ts-mode-indent-offset) | ||
| (nxml-mode . editorconfig--get-indentation-nxml-mode) | ||
| (objc-mode c-basic-offset) | ||
| (octave-mode octave-block-offset) | ||
|
|
@@ -266,12 +267,15 @@ This hook will be run even when there are no matching sections in | |
| (templ-ts-mode go-ts-mode-indent-offset js-indent-level) | ||
| (toml-ts-mode toml-ts-mode-indent-offset) | ||
| (typescript-ts-base-mode typescript-ts-mode-indent-offset) | ||
| (typst-ts-mode typst-ts-indent-offset) | ||
WiredMic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| (verilog-mode verilog-indent-level | ||
| verilog-indent-level-behavioral | ||
| verilog-indent-level-declaration | ||
| verilog-indent-level-module | ||
| verilog-cexp-indent | ||
| verilog-case-indent) | ||
| (vhdl-mode . editorconfig--get-indentation-vhdl-mode) | ||
| (vhdl-ts-mode vhdl-ts-indent-level) | ||
WiredMic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| (web-mode . editorconfig--get-indentation-web-mode) | ||
| (yaml-ts-mode yaml-indent-offset)) | ||
| "Alist of indentation setting methods by modes. | ||
|
|
@@ -305,7 +309,7 @@ When variable `buffer-file-name' matches any of the regexps, then | |
| (with-eval-after-load 'recentf | ||
| (add-to-list 'editorconfig-exclude-regexps | ||
| (rx-to-string '(seq string-start | ||
| (eval (file-truename (expand-file-name recentf-save-file)))) | ||
| (eval (file-truename (expand-file-name recentf-save-file)))) | ||
| t))) | ||
|
|
||
| (defcustom editorconfig-trim-whitespaces-mode | ||
|
|
@@ -413,6 +417,11 @@ Make a message by passing ARGS to `format-message'." | |
| (t t)) | ||
| `((lisp-indent-offset . ,size)))) | ||
|
|
||
| (defun editorconfig--get-indentation-vhdl-mode (size) | ||
| "Set VHDL indentation to SIZE and handle its custom indent-tabs-mode." | ||
| `((vhdl-basic-offset . ,size) | ||
| (vhdl-indent-tabs-mode . ,indent-tabs-mode))) | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you have
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
From line 4471. |
||
| (cl-defun editorconfig--should-set (symbol) | ||
| "Determine if editorconfig should set SYMBOL." | ||
| (display-warning '(editorconfig editorconfig--should-set) | ||
|
|
@@ -444,7 +453,7 @@ set them to. | |
| Major modes are expected to set this buffer-locally.") | ||
|
|
||
| (defun editorconfig--default-indent-size-function (size) | ||
| "Guess which variables to set to for the indentation step to have size SIZE. | ||
| "Guess which variables to set to for the indentation step to have size SIZE. | ||
| This relies on `editorconfig-indentation-alist' supplemented with a crude | ||
| heuristic for those modes not found there." | ||
| (let ((parents (if (fboundp 'derived-mode-all-parents) ;Emacs-30 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
nix-ts-modefollowed the convention of usingFOO-indent-offset(instead ofFOO-mode-indent-offset), your patch would not be needed. So I suggest a bug report to the nix-ts-mode maintainers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have send a bug report upstream.
nix-community/nix-ts-mode#69
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Stefan, I'm a committer on
nix-ts-mode, and I could conceivably help get this changed via aliasing and deprecation, but I've seen the same pattern in other popular modes out there, e.g.toml-ts-mode. It seems strange to require the-mode-not to be there, as that is a reasonable part of a variable name. I personally think it would be better to adjust the heuristic here.