Giter VIP home page Giter VIP logo

dtrt-indent's People

Contributors

ambihelical avatar andyleejordan avatar azuk avatar brownts avatar colonelpanic8 avatar corecode avatar fjl avatar gzz2000 avatar hargonix avatar hlissner avatar jipodine avatar jscheid avatar mbarbon avatar mekeor avatar mernst avatar mzimnn avatar rhaschke avatar rrthomas avatar sakshamsharma avatar saturday06 avatar schouleu avatar skoppe avatar terlar avatar tummychow avatar vishesh avatar yangyingchao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dtrt-indent's Issues

Fails to set js-indent-offset to 2 for this file

I have this JavaScript file indented with 2 spaces. My default indent is 4 spaces. dtrt-indent fails to guess the correct level for this one and doesn't set the new indentation level at all. I've tried hard to edebug it and understand why this happens: it seems that inside dtrt-indent--skip-to-end-of-match it jumps from the line in my file that starts with describe to the end of the file (based on the syntax pairs, I suppose), and then it never goes back to account for any indented lines. That's my very superficial analysis, since I cannot understand how the algorithm really works or where to fix it.

Also, it works for some other JS files, so it seems to be something in particular with this structure.

'use strict';

describe('Controller: PlayerCtrl', function () {
  // load the controller's module
  beforeEach(module('angularTestApp'));

  var PlayerCtrl, scope;

  // Initialize the controller and a mock scope
  beforeEach(inject(function ($controller, $rootScope) {
    scope = $rootScope.$new();
    PlayerCtrl = $controller('MainCtrl', {
      $scope: scope
    });
  }));

  it('should default player score to a 1000', function () {
    expect().toBe(3);
  });
});

Cheers,
Kao

Guess indentation for new files in a project

Currently, if we create a new file, dtrt will fallback to global default for that language. However, we can potentially do better by looking if we are in project-mode or projectile-mode and then looking at other files in that project (or dtrt can just save the indent settings for projects whenever other files were opened). If we are not in a project, then we can fallback to global mode.

Compilation warnings under Emacs 29.2

First of all, many thanks for dtrt-indent.

I just upgraded to Emacs 29.2 and dtrt-indent 1.16, and now I am getting these compilation warnings:

⛔ Warning (comp): dtrt-indent.el:198:44: Warning: reference to free variable ‘smie-grammar’
⛔ Warning (comp): dtrt-indent.el:200:25: Warning: reference to free variable ‘smie-config--buffer-local’
⛔ Warning (comp): dtrt-indent.el:201:19: Warning: reference to free variable ‘dtrt-indent-run-after-smie’
⛔ Warning (comp): dtrt-indent.el:207:31: Warning: defcustom for ‘dtrt-indent-global-mode’ fails to specify containing group
⛔ Warning (comp): dtrt-indent.el:207:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): dtrt-indent.el:437:2: Warning: custom-declare-variable `dtrt-indent-require-confirmation-flag' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): dtrt-indent.el:580:2: Warning: custom-declare-variable `dtrt-indent-min-matching-indentations' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): dtrt-indent.el:200:53: Warning: the function ‘smie-config-guess’ is not known to be defined.

Improve analysis of files with consistent indentation where offset is guessed wrongly due to merging

dtrt-indent (version 20230302.2151) guesses the following file has an offset of 4, when 2 is what I'd expect:

declare namespace NodeJS {
  interface ProcessEnv {
    NODE_ENV: string;

    FOOBAR: string;
    BAR: string;
    BAZ: string;

    TEST?: string;
    TEST2?: string;
    TEST3?: string;

    OPTION: string;
    ANOTHER_OPTION: string;
    MORE_OPTIONS: string;
  }
}

Output of dtrt-indent-diagnosis:

Guessing offset for /Users/nathaneagleson/schedule-engine/servicechannel-integration/test.ts

Elapsed time for analysis: 0.000 seconds

Total relevant lines: 12 out of 18 (limit: 5000)

Histogram:

     2x   2 spaces
    10x   4 spaces

Analysis:

  offset 2 works for 100.00% of relevant lines, matching 2 distinct offsets - merged with offset 4 (16.67% deviation, limit 20.00%)
  offset 4 works for  83.33% of relevant lines, matching 1 distinct offsets - CONSIDERED
  offset 3 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 5 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 6 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 7 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 8 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)

Summary:

  Best guess is offset 4 with 83.33% matching lines (80.00% required)
  Hard tab percentage: 0.00% (0 lines), -100.00% superior to soft tabs (threshold 300.00%)
  Soft tab percentage: 100.00% (12 lines), inf% superior to hard tabs (threshold 300.00%)

Conclusion:

  Guessed offset 4 with 83% confidence.
  Change indent-tab-setting: yes, to nil

Handle js2-mode

js2-mode is a very popular JavaScript mode. JavaScript has many styles and conflicting indentations preferences. It would be great if dtrt-indent supported this mode.

check adjacent-files like vim-sleuth

More often than not I find myself creating a new file, it would be useful that dtrt adjusts indentation settings based on a few files of the same type adjacent to it, or maybe in the parent directories, would this be possible with the existing code-base? if so, how?

thanks for such a nice plugin, btw

Symbol's value as variable is void: evil-mode

This happens when opening any file. Disabling dtrt-indent removes the error. It appears to be related to the reference in

'((evil-mode evil-shift-width)) ; evil

Is there any way we can get this list made into a defcustom? I, and several users I know, load our packages automatically using a package list that will install a package if it doesn't exist and load it on startup, and this means I have to define a global variable at the top of my user-init-file on startup.

dtrt-indent-try-set-offset doesn't set generic indent variables

On lines 923-924 of dtrt-indent-try-set-offset, the following check

(not (eq (symbol-value indent-offset-variable)
         best-indent-offset))

prevents other variables in dtrt-indent-hook-generic-mapping-list from being
set, even if they don't match the best guess.

i.e. I want evil-shift-width to be set to the best guess, but if the mode's
offset variable (say, ruby-indent-level) already matches the guess, it won't
bother.

I'm guessing this wasn't intentional, so I suggest either removing the check or
checking if all indent-offset-variables match the best guess before short
circuiting. (Shall I PR this?)

do nothing when editor-config is activated

I'm about half-way through the work of packaging dtrt-indent for Debian (we provide and support elpa-foo.deb packages as an alternative to MELPA), and I noticed that it seems to be missing the following logic: if editor-config is active, then do nothing. I'm not sure what the best method would be, but I think that if an upstream project provides an EditorConfig config file, then Do The Right Thing means silently doing nothing is editorconfig.el is installed (and allowing it to activate using its own mechanism), and otherwise not activating dtrt-indent but instead emitting a message to install https://github.com/editorconfig/editorconfig-emacs

Issue with protobuf-mode

When running dtrt on a protocol buffers (cc-mode derived), dtrt sets up standard-indent, yet the protobuf-mode uses c-basic-offset.

What's the correct fix for this?

I tried adding (protobuf-mode c-basic-offset) to dtrt-indent-hook-generic-mapping-list but for some reason the (boundp mode) comes back false when checking for protobuf mode while in protobuf mode.

I'm pretty new at elisp, so I'm looking for some direction on a proper fix. Or, maybe it's a configuration issue on my end?

Adapting tab mode to file content not working

The documentation made me expect dtrt-indent to adapt indent-tabs-mode to "the right thing":

;; `indent-tabs-mode' Setting
;;
;; For determining hard vs. soft tabs, dtrt-indent counts the number of
;; lines out of the eligible lines in the fixed segment that are
;; indented using hard tabs, and the number of lines indented using
;; spaces.  If either count is significantly higher than the other count,
;; `indent-tabs-mode' will be modified.

However, opening this file /tmp/asdf.sh with basic init file ~/tmp/basic-init.el does not seem to guess and modify to the right value of indent-tabs-mode.


Test material

/tmp/asdf.sh:

#! /usr/bin/env bash

function asdf()
{
    printf "asASDFASDF"
    echo "1234"
}

printf "qwerqwerqwer\n"
result=$(asdf)

if [ df ] ; then
    if [ er ] ; then
        wefwefew
    fi
fi

basic-init.el:

(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpamilk" . "http://melpa.milkbox.net/packages/"))
(package-initialize)

(unless package-archive-contents
  (package-refresh-contents))
(unless (package-installed-p 'use-package)
  (package-install 'use-package))
(require 'use-package)

(defun my-prog-mode-hook ()
  (dtrt-indent-mode))

(use-package dtrt-indent
  :ensure t
  :config (dtrt-indent-mode t))

(require 'whitespace) ;; builtin
(global-set-key (kbd "C-c b") 'whitespace-mode)
(delete 'indentation whitespace-style) ; no warning about indent with spaces

Test result

Starting emacs with emacs -q -l ~/tmp/basic-init.el /tmp/asdf.sh, then activating whitespace mode with C-c b gives me this:
Screenshot_2021-05-28_133545

After going to the row with 8 space indent (wefwefew), deleting one space, pressing TAB, I get this:
Screenshot_2021-05-28_133934

Expected result: dtrt-indent-mode indents with spaces, since all other indentations are with spaces.


Debug data

Here is what I have found so far.

Result of dtrt-indent-diagnosis:

Guessing offset for /tmp/asdf.sh

Elapsed time for analysis: 0.001 seconds

Total relevant lines: 5 out of 17 (limit: 5000)

Histogram:

     4x   4 spaces
     1x   8 spaces

Analysis:

  offset 2 works for 100.00% of relevant lines, matching 2 distinct offsets - merged with offset 4 (0.00% deviation, limit 20.00%)
  offset 4 works for 100.00% of relevant lines, matching 2 distinct offsets - CONSIDERED
  offset 8 works for  20.00% of relevant lines, matching 1 distinct offsets - CONSIDERED
  offset 3 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 5 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 6 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 7 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)

Summary:

  Best guess is offset 4 with 100.00% matching lines (80.00% required)
  Hard tab percentage: 20.00% (1 lines), -75.00% superior to soft tabs (threshold 300.00%)
  Soft tab percentage: 80.00% (4 lines), 300.00% superior to hard tabs (threshold 300.00%)

Conclusion:

  Guessed offset 4 with 100% confidence.
  Change indent-tab-setting: yes, to nil

It seems dtrt-indent-mode could correctly guess that indent-tab-setting (although there is no such variable? Is there? Wrong name? Shouldn't it be indent-tabs-mode?) should be nil.
But it could only hint the user that they probably want to set it to nil (the message seems to be a recommendation, although it is not obvious. At first glance, it looks like dtrt-indent actually made the change).

C-h v indent-tabs-mode is t, so it was not changed. According to the code comment I posted at the top, it should?

The embedded help I open from that emacs session says:

When dtrt-indent mode is enabled, the proper indentation offset
and ‘indent-tabs-mode’ will be guessed for newly opened files and
adjusted transparently.

package-list-packages tells me that what I have installed is this:

     Status: Installed in ‘dtrt-indent-20210423.745/’ (unsigned). Delete
    Version: 20210423.745
     Commit: 9714f2c5f1c9b7c21e732df8c15a870a88caba84
    Summary: Adapt to foreign indentation offsets
   Keywords: convenience files languages c 
Other versions: 20210423.745 (melpa), 20200430.1023 (melpamilk).

does this change my indent-tabs-mode?

If so, I think that's a cardinal sin!

I started discovering tabs in my files recently, and noticed that I am now sometimes in indent-tabs-mode t, which is strange because I explicitly set this to nil with my programming mode hooks.

Use of this package is the only thing that has changed recently, and I do notice in the source that it seems to be mucking with indent-tabs-mode.

Advice is active regardless of whether the mode is active

(defadvice hack-one-local-variable (before dtrt-indent-advise-hack-one-local-variable activate)

That activate means that the advice is immediately doing things if the library is loaded, regardless of whether the user intends for dtrt-indent to be active.

The version I had installed used a :global minor mode, and therefore I had written a fix to enable/disable the advice in the body of that mode. I see that the current code has switched to a globalized mode, so the situation is more awkward now, as people can enable the buffer-local minor mode independently of the global mode.

As such my intended fix isn't useful as a pull request; but I still think that advice should do as little as possible in cases where dtrt-indent isn't going to act.

And in any case, there should be a defun dtrt-indent-unload-function which disables the advice (refer to (elisp) Unloading).

FWIW the following is what I'd written for the old global mode:

modified   el-get/dtrt-indent/dtrt-indent.el
@@ -159,7 +159,16 @@ mode.
 When dtrt-indent mode is enabled, the proper indentation
 offset will be guessed for newly opened files and adjusted
 transparently."
-  :global t :group 'dtrt-indent)
+  :global t :group 'dtrt-indent
+  (if dtrt-indent-mode
+      (progn
+        (ad-enable-advice 'hack-one-local-variable 'before
+                          'dtrt-indent-advise-hack-one-local-variable)
+        (ad-activate 'hack-one-local-variable))
+    ;; Disable mode.
+    (ad-disable-advice 'hack-one-local-variable 'before
+                       'dtrt-indent-advise-hack-one-local-variable)
+    (ad-activate 'hack-one-local-variable)))
 
 (defvar dtrt-indent-language-syntax-table
   '((c/c++/java ("\""                    0   "\""       nil "\\\\.")
@@ -929,7 +938,7 @@ Note: killed buffer-local value for %s, restoring to default %d"
 (add-hook 'dtrt-indent-unload-hook 'dtrt-indent-unload-hook)
 
 (defadvice hack-one-local-variable
-  (before dtrt-indent-advise-hack-one-local-variable activate)
+  (before dtrt-indent-advise-hack-one-local-variable disable)
   "Adviced by dtrt-indent.
 
 Disable dtrt-indent if offset explicitly set."

web-mode support

web-mode.org looks pretty neat, it'd be great if I could get it to not have terrible indentation.

It supports multiple languages with different levels, so probably you want multiple lines added to dtrt-indent-hook-mapping-list (and I don't know if this will work):

    (web-mode-prog-mode        javascript    web-mode-code-indent-offset) ;
    (web-mode-prog-mode        css                  web-mode-css-indent-offset) ;
    (web-mode-prog-mode        sgml              web-mode-markup-indent-offset) ;

Also it does its own funky thing involving tabs (have to call (web-mode-use-tabs) or (web-mode-use-spaces), and hopefully that is buffer specific and not global), so you might need to add an extension mechanism for tabs similar to that for indents.

Detects indents in json-mode incorrectly

I often get 4 space indent instead of 2 within json files. Here's an example:

{
  "extends": ["tslint:latest", "tslint-react"],
  "rules": {
    "array-type": [true, "array"],
    "arrow-parens": [true, "ban-single-arg-parens"],
    "arrow-return-shorthand": [true, "multiline"],
    "await-promise": true,
    "curly": false,
    "interface-name": [true, "never-prefix"],
    "match-default-export-name": true,
    "max-line-length": [true, 120],
    "member-access": false,
    "no-consecutive-blank-lines": [true, 1],
    "no-duplicate-super": true,
    "no-floating-promises": true,
    "no-trailing-whitespace": [true, "ignore-comments"],
    "no-unsafe-finally": true,
    "no-unused-expression": [true, "allow-fast-null-checks"],
    "object-literal-sort-keys": false,
    "ordered-imports": true,
    "prefer-const": true,
    "quotemark": [true, "single", "jsx-double"],
    "semicolon": [true, "never"],
    "trailing-comma": [true, {"multiline": "always", "singleline": "never"}],
    "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"],
    "jsx-alignment": true,
    "jsx-ban-props": true,
    "jsx-boolean-value": [true, "never"],
    "jsx-no-lambda": false,
    "jsx-no-string-ref": true,
    "jsx-self-close": true,
    "jsx-wrap-multiline": true,
    "jsx-no-multiline-js": false
  }
}

And dtrt-indent-diagnosis:

Guessing offset for /Users/aaronjensen/Source/epic-trello/tslint.json

Elapsed time for analysis: 0.001 seconds

Total relevant lines: 33 out of 36 (limit: 5000)

Histogram:

     3x   2 spaces
    30x   4 spaces

Analysis:

  offset 2 works for 100.00% of relevant lines, matching 2 distinct offsets - merged with offset 4 (9.09% deviation, limit 20.00%)
  offset 4 works for  90.91% of relevant lines, matching 1 distinct offsets - CONSIDERED
  offset 3 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 5 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 6 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 7 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)
  offset 8 works for   0.00% of relevant lines, matching 0 distinct offsets - rejected: too few distinct matching offsets (1 required)

Summary:

  Best guess is offset 4 with 90.91% matching lines (80.00% required)
  Hard tab percentage: 0.00% (0 lines), -100.00% superior to soft tabs (threshold 300.00%)
  Soft tab percentage: 100.00% (33 lines), inf% superior to hard tabs (threshold 300.00%)

Conclusion:

  Guessed offset 4 with 91% confidence.
  Change indent-tab-setting: yes, to nil

Support SMIE (Emacs 24.4)

Many Emacs 24.4 major modes are now using SMIE, a parser that improves automatic indentation and indentation based navigation. Many minor modes have switched to using it instead of the normal indentation variables, which breaks dtrt-indent in sh-mode for example.

Delay for running dtrt-indent

When using functions such as projectile-replace, every time I visit a buffer dtrt scans the file for detecting the indent. Is there a way to set a delay for this to happen?

I am often visiting 300+ files at a time, and it would be great if dtrt-indent didn't try to set the c-basic-offset unless I stayed in the buffer for half a second, for instance.

Support for different js-mode offset variables

Since js-mode has different offset variables, I was wondering if we could support those also.

Currently, if I use this file:

function test(arg) {
    switch(arg) {
      case 'foo':
          return 'bar'
      default:
          return 'baz'
    }
}

the guessed indentation is 2.

The problem is that js-switch-indent-offset was set to 2.

Error while processing typescript files

dtrt-indent version: 1.13 (69d8e93)
emacs version: 30.0.50 (master)

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  dtrt-indent--skip-to-end-of-match(nil nil nil nil)
  dtrt-indent--for-each-indentation(typescript #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_3> (#<hash-table eql 0/65 0x1592c6ad35ef ...> . 0))
  dtrt-indent--calc-histogram(typescript)
  dtrt-indent-try-set-offset()
  dtrt-indent-mode()

Overriding tab setting for hard tabbed file

I have a source tree which uses hard tabs for indentation and which assumes tab width is a value different than my default tab-width (as set up in init.el). I'd like to tell dtrt-indent via .dir-locals.el to set that tab-width and let it set any related variables (e.g. evil-shift-width). I've failed so far to do this.

If I set tab-width in .dir-locals.el, that sets only tab-width, dtrt-indent seems to use my default values for everything else.I get the same result by setting c-basic-offset.
Here is the messages I get for dtrt-indent in both cases (I am trying to set tab width to 3 via .dir-locals.el, my init.el sets tab-width and evil-shift-width to 4, I don't set c-basic-offset at all):

Note: c-basic-offset, evil-shift-width adjusted to 4
Note: indent-tabs-mode adjusted to t

Is there a way to do this?

Here is my setup for dtrt-indent:

(use-package dtrt-indent
  :hook (( prog-mode text-mode ) . dtrt-indent-mode)
  :init
  (setq dtrt-indent-run-after-smie t)
  :config)

Package for MELPA

Hi,

It would be really awesome to use dtrt-indent from MELPA. Have you considered packaging for it?

Cheers

Wrong indentation in shell-mode

It seems like dtrt-indent doesn't work very well with shell-mode (bash):

test_function() {
    if foo; then
        echo bar
    fi
}

dtrt-indent guesses sh-indentation 4, which is correct. However, if I call indent-region the code indented like this:

test_function() {
  if foo; then
      echo bar
  fi
}

It looks like a mixed indentation of 2 and 4. This is probably because sh-basic-offset is still set to 2. Am I missing something? Setting sh-basic-offset to the same value like sh-indentation fixes the problem. Does it mean there are two different settings which control indentation for shell mode? Is this an upstream "bug"?

Unfortunately, I don't understand the documentation:

sh-indentation is a variable defined in ‘sh-script.el’.
Its value is 4

Documentation:
The width for further indentation in Shell-Script mode.
sh-basic-offset is a variable defined in ‘sh-script.el’.
Its value is 2

Documentation:
The default indentation increment.
This value is used for the ‘+’ and ‘-’ symbols in an indentation variable.

There is also a setting if basic offset should be guesses:

sh-guess-basic-offset is a compiled Lisp function in ‘sh-script.el’.

(sh-guess-basic-offset VEC)

See if we can determine a reasonable value for ‘sh-basic-offset’.
This is experimental, heuristic and arbitrary!
Argument VEC is a vector of information collected by
‘sh-learn-buffer-indent’.
Return values:
  number          - there appears to be a good single value
  list of numbers - no obvious one, here is a list of one or more
		    reasonable choices
  nil		  - we couldn’t find a reasonable one.

[back]

Do we really need dtrt-mode for shell?

web-mode support doesn't work well for heterogeneous indent types

I have a codebase that uses different values for different web-mode indentation variables within .tsx files. For example:

(setq web-mode-code-indent-offset 2)
(setq web-mode-markup-indent-offset 4)

Here's some code written this way:

import Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
import { useCallback } from "react";

export default function FooBarMenu() {
  const fooCallback = useCallback(() => {
    console.log("foo");
  }, []);

  return (
    <Menu label="Foo"
          disabled={false}>
        <MenuItem className=""
                  onClick={fooCallback}>
            Foo
        </MenuItem>
    </Menu>
  );
}

When I run dtrt-indent-diagnosis, it says "Guessed offset 2 with 100% confidence" and sets all my variables to 2. No doubt because it expects them all to be the same; see here.

Unfortunately this is probably hard to fix because it requires a more detailed understanding of JSX/TSX files.

Support `typescript-ts-base-mode` and thus `tsx-ts-mode`?

Currently, dtrt-indent supports typescript-ts-mode. But both typescript-ts-mode as well as tsx-ts-mode are derived from typescript-base-ts-mode. Is it intended that tsx-ts-mode and typescript-base-ts-mode are not supported by dtrt-indent?

How to install this?

The instructions state:

;; To install, M-x customize-group dtrt-indent-global, and turn on "Dtrt
;; Indent Global Mode".

However, the group dtrt-indent-global is not available for me. I guess I have to put the *.el files from the repository somewhere and load them somehow, but I am unsure what exactly the proper steps are.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.