Skip to content

Commit dc17943

Browse files
authored
Indent imports from submodule correctly (#154)
* Indent using/import from submodules correctly * Add changelog entry
1 parent 5cccdbd commit dc17943

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- fix indentation of submodule imports
4+
35
# 0.4
46

57
- increase lookback ([#98](https://github.com/JuliaEditorSupport/julia-emacs/pull/98)), fixes [#5](https://github.com/JuliaEditorSupport/julia-emacs/issues/5)

julia-mode-tests.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,15 @@ notpartofit"
390390
"using Foo: bar ,
391391
baz,
392392
quux
393+
notpartofit")
394+
(julia--should-indent
395+
"using Foo.Bar: bar ,
396+
baz,
397+
quux
398+
notpartofit"
399+
"using Foo.Bar: bar ,
400+
baz,
401+
quux
393402
notpartofit"))
394403

395404
(ert-deftest julia--test-indent-anonymous-function ()

julia-mode.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ symbol, gives up when this is not true."
428428
(setf module (match-string-no-properties 1))))
429429
((looking-at (rx (* (or word (syntax symbol))) (0+ space) ","))
430430
(when module (setf done 'broken)))
431+
((looking-at (rx (* (or word (syntax symbol))) "."))
432+
(setf module (concat (match-string-no-properties 0) module)))
431433
(t (setf done 'broken)))))
432434
(if (eq done 'broken)
433435
nil

0 commit comments

Comments
 (0)