Skip to content

Commit 136a5ff

Browse files
committed
minor refactors
1 parent c0ec452 commit 136a5ff

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/Atom.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ function __init__()
2222

2323
# HACK: overloading this allows us to open remote files
2424
InteractiveUtils.eval(quote
25-
function InteractiveUtils.edit(path::AbstractString, line::Integer=0)
25+
function InteractiveUtils.edit(path::AbstractString, line::Integer = 0)
2626
if endswith(path, ".jl")
27-
f = Base.find_source_file(path)
28-
f !== nothing && (path = f)
27+
f = Base.find_source_file(path)
28+
f !== nothing && (path = f)
2929
end
30-
$(msg)("openFile", Base.abspath(path), line-1)
30+
$(msg)("openFile", Base.abspath(path), line - 1)
3131
end
3232
end)
3333
end

src/goto.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const PathItemsMaps = Dict{String, Vector{ToplevelItem}}
120120
"""
121121
Atom.SYMBOLSCACHE
122122
123-
"module" (`String`) ⟶ "path" (`String`) ⟶ "symbols" (`Vector{ToplevelItem}`) map
123+
"module" (`String`) ⟶ "path" (`String`) ⟶ "symbols" (`Vector{ToplevelItem}`) map.
124124
125125
!!! note
126126
"module" should be canonical, i.e.: should be identical to names that are
@@ -146,26 +146,24 @@ function toplevelgotoitems(word, mod, path, text)
146146
return ret
147147
end
148148

149-
# entry method
149+
# entry methods
150150
function collecttoplevelitems(mod::Module, path::String, text::String)
151151
pathitemsmaps = PathItemsMaps()
152152
return if mod == Main || isuntitled(path)
153153
# for `Main` module and unsaved editors, always use CSTPraser-based approach
154154
# with a given buffer text, and don't check module validity
155155
_collecttoplevelitems!(nothing, path, text, pathitemsmaps)
156156
else
157-
_collecttoplevelitems!(mod, pathitemsmaps)
157+
collecttoplevelitems!(mod, pathitemsmaps)
158158
end
159159
end
160-
161-
# entry method when called from docpane/workspace
162-
function collecttoplevelitems(mod::Module, path::Nothing, text::String)
160+
function collecttoplevelitems(mod::Module, path::Nothing, text::String) # when called from docpane/workspace
163161
pathitemsmaps = PathItemsMaps()
164-
_collecttoplevelitems!(mod, pathitemsmaps)
162+
collecttoplevelitems!(mod, pathitemsmaps)
165163
end
166164

167165
# sub entry method
168-
function _collecttoplevelitems!(mod::Module, pathitemsmaps::PathItemsMaps)
166+
function collecttoplevelitems!(mod::Module, pathitemsmaps::PathItemsMaps)
169167
entrypath, paths = modulefiles(mod)
170168
return if entrypath !== nothing # Revise-like approach
171169
_collecttoplevelitems!(stripdotprefixes(string(mod)), entrypath, paths, pathitemsmaps)

0 commit comments

Comments
 (0)