Closed preetpalS closed 9 years ago
Hey @preetpalS I checked this against latest master and it looks ok. Can you try updating the package, melpa
has 20150818.1958
?
I am using that version of the package (and its the latest version at this time). Here is some information about my Emacs installation and the version of package I am using.
(emacs-version)
"GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.0.0, NS appkit-1343.16 Version 10.10.1 (Build 14B25))
of 2015-01-21 on Preetpals-Air"
;;;; Copied from Swift-Mode package
;; Authors: Chris Barrett <chris.d.barrett@me.com>
;; Bozhidar Batsov <bozhidar@batsov.com>
;; Arthur Evstifeev <lod@pisem.net>
;; Version: 0.4.0-cvs
;; Package-Version: 20150818.1958
;; Package-Requires: ((emacs "24.4"))
;; Keywords: languages swift
I was able to reproduce the bug by starting Emacs with the --no-init flag, opening and evaluating the swift-mode.el file from the melpa package on my computer (Package-Version: 20150818.1958), and then opening and indenting a file containing all of the cases I reported in the issue.
Results of indenting the file containing all cases initially reported in the issue are below:
import Cocoa
class Test {
}
import Cocoa
import Darwin
class Test {
}
import Darwin
import Cocoa
class Test {
}
import Cocoa
import Darwin;
class Test {
}
Screenshots taken while trying to reproduce issue.
Oh sorry, I missed the title of the issue :) Yep that's definitelly an issue with lexer's regex for in
token. Seems like we are not tokenizing it, so it's a default lexer's issue. Will look into it.
No worries :), thanks for fixing this issue.
For example, if you import the "Darwin" module, the next line gets indented incorrectly. The following indentation examples were all indented by selecting all text in the buffer and indenting everything.
Good
Incorrect indentation
Incorrect indentation
Workaround (use semicolon)