Skip to content
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

Indentation issues #227

Closed
svs opened this issue Jul 18, 2015 · 6 comments · Fixed by #231
Closed

Indentation issues #227

svs opened this issue Jul 18, 2015 · 6 comments · Fixed by #231

Comments

@svs
Copy link

svs commented Jul 18, 2015

I've copy pasted an example from Dave Thomas's Programming Elixir and the indentation is very weird. Example reproduced below:

defmodule Issues.CLI do
    @default_count 4
    @moduledoc """
    Handle the command line parsing and the dispatch to
    the various functions that end up generating a
    table of the last _n_ issues in a github project
    """
    def run(argv) do
        parse_args(argv)
    end
    @doc """
    `argv` can be -h or --help, which returns :help.
    Otherwise it is a github user name, project name, and (optionally)
    the number of entries to format.
    Return a tuple of `{ user, project, count }`, or `:help` if help was given.
    """
    def parse_args(argv) do
        parse = OptionParser.parse(argv, switches: [ help: :boolean],
                                                             aliases: [ h: :help ])
        case parse do
            { [ help: true ], _, _ }
                                 -> :help
                                        { _, [ user, project, count ], _ }
                                        -> { user, project, count }
                                             { _, [ user, project ], _ }
                                             -> { user, project, @default_count }
                                             _ -> :help
        end
    end
end

I'm using v. 2.2.5 from melpa-stable.

thanks.

@tonini
Copy link
Contributor

tonini commented Jul 18, 2015

@svs Thanks for reporting. 👍

@tonini
Copy link
Contributor

tonini commented Aug 4, 2015

Thanks! Is fixed with #231

@tonini tonini closed this as completed Aug 4, 2015
@svs
Copy link
Author

svs commented Aug 22, 2015

        case parse do
            { [ help: true ], _, _ }
                -> :help
            { _, [ user, project, count ], _ }
                -> { user, project, count }
                { _, [ user, project ], _ }
                -> { user, project, @default_count }
                _ -> :help
        end

the third and fourth cases are improperly implemented.

@tonini
Copy link
Contributor

tonini commented Aug 22, 2015

I can't reproduce this so far.

I tried the following code and it always indent correct.

case parse do
  { [ help: true ], _, _ }
    -> :help
  { _, [ user, project, count ], _ }
    -> { user, project, count }
  { _, [ user, project ], _ }
    -> { user, project, @default_count }
  _ -> :help
end

def asdasd do
  case parse do
    { [ help: true ], _, _ }
      -> :help
    { _, [ user, project, count ], _ }
      -> { user, project, count }
    { _, [ user, project ], _ }
      -> { user, project, @default_count }
    _ -> :help
  end
end

What version of elixir-mode are you using?

@svs
Copy link
Author

svs commented Aug 22, 2015

2.2.6

@tonini
Copy link
Contributor

tonini commented Aug 23, 2015

Ok, I tested it intensively and a few other elixir-mode users too and we couldn't reproduce the issue.

I'm wondering if you indent it specific, like go to the line and indent or select the whole block and indent?

I really can't get any issue there.

J3RN pushed a commit to J3RN/emacs-elixir that referenced this issue Apr 24, 2021
J3RN pushed a commit to J3RN/emacs-elixir that referenced this issue Apr 24, 2021
* WorkspaceSymbols index after successful build

Previously WorkspaceSymbols depended on a side-effect of running Dialyzer:
elixir-lsp/elixir-ls#110 (comment)

Now that the Build step loads all modules (added in elixir-editors#227) we need to change the
WorkspaceSymbols index to be rebuilt after a successful compile.

* Fix tests

Allow WorkspaceSymbol to have it's own instance of the GenServer for the test by
being parameterized by the server's registered name

* Give Server some more time to respond

This is probably necessary now because workspace symbols is running earlier

* Bump up the timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants