Skip to content

Commit 9ec527e

Browse files
committed
Windows debugging
1 parent e062942 commit 9ec527e

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

base/REPLCompletions.jl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,22 @@ function complete_path(path::AbstractString, pos; use_envpath=false)
111111
dir, prefix = splitdir(path)
112112
end
113113
local files
114-
try
114+
# try
115115
if isempty(dir)
116116
files = readdir()
117117
elseif isdir(dir)
118118
files = readdir(dir)
119119
else
120120
return String[], 0:-1, false
121121
end
122-
catch
123-
return String[], 0:-1, false
124-
end
122+
# catch
123+
# return String[], 0:-1, false
124+
# end
125125

126126
matches = Set{String}()
127127
for file in files
128128
if startswith(file, prefix)
129-
id = try isdir(joinpath(dir, file)) catch; false end
129+
id = isdir(joinpath(dir, file))
130130
# joinpath is not used because windows needs to complete with double-backslash
131131
push!(matches, id ? file * (@static is_windows() ? "\\\\" : "/") : file)
132132
end
@@ -138,12 +138,12 @@ function complete_path(path::AbstractString, pos; use_envpath=false)
138138

139139
for pathdir in pathdirs
140140
local actualpath
141-
try
141+
# try
142142
actualpath = realpath(pathdir)
143-
catch
143+
# catch
144144
# Bash doesn't expect every folder in PATH to exist, so neither shall we
145-
continue
146-
end
145+
# continue
146+
# end
147147

148148
if actualpath != pathdir && in(actualpath,pathdirs)
149149
# Remove paths which (after resolving links) are in the env path twice.
@@ -152,17 +152,17 @@ function complete_path(path::AbstractString, pos; use_envpath=false)
152152
end
153153

154154
local filesinpath
155-
try
155+
# try
156156
filesinpath = readdir(pathdir)
157-
catch e
157+
# catch e
158158
# Bash allows dirs in PATH that can't be read, so we should as well.
159-
if isa(e, SystemError)
160-
continue
161-
else
159+
# if isa(e, SystemError)
160+
# continue
161+
# else
162162
# We only handle SystemErrors here
163-
rethrow(e)
164-
end
165-
end
163+
# rethrow(e)
164+
# end
165+
# end
166166

167167
for file in filesinpath
168168
# In a perfect world, we would filter on whether the file is executable

test/replcompletions.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,13 @@ if is_windows()
634634
file = basename(tmp)
635635
temp_name = basename(path)
636636
cd(path) do
637+
@test isdir(path)
638+
@test !isempty(path)
639+
readdir(path)
640+
637641
s = "cd ..\\\\"
638642
c,r = test_scomplete(s)
639-
@test r == length(s)+1:length(s)
643+
@test r == length(s)+1+0:length(s)
640644
@test temp_name * "\\\\" in c
641645

642646
s = "ls $(file[1:2])"

0 commit comments

Comments
 (0)