13
13
function filtered_mod_names (ffunc:: Function , mod:: Module , name:: AbstractString , all:: Bool = false , imported:: Bool = false )
14
14
ssyms = names (mod, all, imported)
15
15
filter! (ffunc, ssyms)
16
- syms = UTF8String [string (s) for s in ssyms]
16
+ syms = String [string (s) for s in ssyms]
17
17
filter! (x-> completes_global (x, name), syms)
18
18
end
19
19
@@ -47,12 +47,12 @@ function complete_symbol(sym, ffunc)
47
47
lookup_module = false
48
48
t, found = get_type (ex, context_module)
49
49
end
50
- found || return UTF8String []
50
+ found || return String []
51
51
# Ensure REPLCompletion do not crash when asked to complete a tuple, #15329
52
- ! lookup_module && t <: Tuple && return UTF8String []
52
+ ! lookup_module && t <: Tuple && return String []
53
53
end
54
54
55
- suggestions = UTF8String []
55
+ suggestions = String []
56
56
if lookup_module
57
57
# We will exclude the results that the user does not want, as well
58
58
# as excluding Main.Main.Main, etc., because that's most likely not what
@@ -82,7 +82,7 @@ function complete_symbol(sym, ffunc)
82
82
suggestions
83
83
end
84
84
85
- function complete_keyword (s:: ByteString )
85
+ function complete_keyword (s:: String )
86
86
const sorted_keywords = [
87
87
" abstract" , " baremodule" , " begin" , " bitstype" , " break" , " catch" , " ccall" ,
88
88
" const" , " continue" , " do" , " else" , " elseif" , " end" , " export" , " false" ,
@@ -117,13 +117,13 @@ function complete_path(path::AbstractString, pos; use_envpath=false)
117
117
elseif isdir (dir)
118
118
files = readdir (dir)
119
119
else
120
- return UTF8String [], 0 : - 1 , false
120
+ return String [], 0 : - 1 , false
121
121
end
122
122
catch
123
- return UTF8String [], 0 : - 1 , false
123
+ return String [], 0 : - 1 , false
124
124
end
125
125
126
- matches = Set {UTF8String } ()
126
+ matches = Set {String } ()
127
127
for file in files
128
128
if startswith (file, prefix)
129
129
id = try isdir (joinpath (dir, file)) catch ; false end
@@ -174,7 +174,7 @@ function complete_path(path::AbstractString, pos; use_envpath=false)
174
174
end
175
175
end
176
176
177
- matchList = UTF8String [replace (s, r" \s " , " \\ " ) for s in matches]
177
+ matchList = String [replace (s, r" \s " , " \\ " ) for s in matches]
178
178
startpos = pos - endof (prefix) + 1 - length (matchall (r" " , prefix))
179
179
# The pos - endof(prefix) + 1 is correct due to `endof(prefix)-endof(prefix)==0`,
180
180
# hence we need to add one to get the first index. This is also correct when considering
@@ -289,7 +289,7 @@ function get_type_call(expr::Expr)
289
289
(tree, return_type) = Core. Inference. typeinf (linfo, m[1 ], m[2 ])
290
290
return return_type, true
291
291
end
292
- # Returns the return type. example: get_type(:(Base.strip("",' ')),Main) returns (ASCIIString ,true)
292
+ # Returns the return type. example: get_type(:(Base.strip("",' ')),Main) returns (String ,true)
293
293
function get_type (sym:: Expr , fn)
294
294
sym= expand (sym)
295
295
val, found = get_value (sym, fn)
@@ -313,12 +313,12 @@ end
313
313
function complete_methods (ex_org:: Expr )
314
314
args_ex = DataType[]
315
315
func, found = get_value (ex_org. args[1 ], Main)
316
- ! found && return UTF8String []
316
+ ! found && return String []
317
317
for ex in ex_org. args[2 : end ]
318
318
val, found = get_type (ex, Main)
319
319
push! (args_ex, val)
320
320
end
321
- out = UTF8String []
321
+ out = String []
322
322
t_in = Tuple{Core. Typeof (func), args_ex... } # Input types
323
323
na = length (args_ex)+ 1
324
324
for method in methods (func)
@@ -341,7 +341,7 @@ const bslash_separators = [whitespace_chars..., "\"'`"...]
341
341
342
342
# Aux function to detect whether we're right after a
343
343
# using or import keyword
344
- function afterusing (string:: ByteString , startpos:: Int )
344
+ function afterusing (string:: String , startpos:: Int )
345
345
(isempty (string) || startpos == 0 ) && return false
346
346
str = string[1 : prevind (string,startpos)]
347
347
isempty (str) && return false
@@ -376,7 +376,7 @@ function bslash_completions(string, pos)
376
376
return (true , (sort! (collect (latex_names)), slashpos: pos, true ))
377
377
end
378
378
end
379
- return (false , (UTF8String [], 0 : - 1 , false ))
379
+ return (false , (String [], 0 : - 1 , false ))
380
380
end
381
381
382
382
function completions (string, pos)
@@ -404,7 +404,7 @@ function completions(string, pos)
404
404
ok && return ret
405
405
406
406
# Make sure that only bslash_completions is working on strings
407
- inc_tag== :string && return UTF8String [], 0 : - 1 , false
407
+ inc_tag== :string && return String [], 0 : - 1 , false
408
408
409
409
if inc_tag == :other && should_method_complete (partial)
410
410
frange, method_name_end = find_start_brace (partial)
@@ -415,14 +415,14 @@ function completions(string, pos)
415
415
return complete_methods (ex), start (frange): method_name_end, false
416
416
end
417
417
elseif inc_tag == :comment
418
- return UTF8String [], 0 : - 1 , false
418
+ return String [], 0 : - 1 , false
419
419
end
420
420
421
421
dotpos = rsearch (string, ' .' , pos)
422
422
startpos = nextind (string, rsearch (string, non_identifier_chars, pos))
423
423
424
424
ffunc = (mod,x)-> true
425
- suggestions = UTF8String []
425
+ suggestions = String []
426
426
comp_keywords = true
427
427
if afterusing (string, startpos)
428
428
# We're right after using or import. Let's look only for packages
@@ -500,10 +500,10 @@ function shell_completions(string, pos)
500
500
try
501
501
args, last_parse = Base. shell_parse (scs, true )
502
502
catch
503
- return UTF8String [], 0 : - 1 , false
503
+ return String [], 0 : - 1 , false
504
504
end
505
505
# Now look at the last thing we parsed
506
- isempty (args. args[end ]. args) && return UTF8String [], 0 : - 1 , false
506
+ isempty (args. args[end ]. args) && return String [], 0 : - 1 , false
507
507
arg = args. args[end ]. args[end ]
508
508
if all (s -> isa (s, AbstractString), args. args[end ]. args)
509
509
# Treat this as a path
@@ -525,7 +525,7 @@ function shell_completions(string, pos)
525
525
range += first (r) - 1
526
526
return ret, range, true
527
527
end
528
- return UTF8String [], 0 : - 1 , false
528
+ return String [], 0 : - 1 , false
529
529
end
530
530
531
531
end # module
0 commit comments