@@ -84,6 +84,16 @@ function edit(path::AbstractString, line::Integer=0)
84
84
nothing
85
85
end
86
86
87
+ # Workaround for https://github.com/JuliaLang/julia/issues/26314
88
+ const BUILDBOT_STDLIB_PATH = dirname (abspath (joinpath (functionloc (eval)[1 ]), " .." , " .." , " .." ))
89
+ function functionloc_stdlib_workaround (args... )
90
+ loc, line = functionloc (args... )
91
+ if loc != = nothing
92
+ loc = replace (loc, BUILDBOT_STDLIB_PATH => Sys. STDLIB)
93
+ end
94
+ return loc, line
95
+ end
96
+
87
97
"""
88
98
edit(function, [types])
89
99
edit(module)
@@ -98,8 +108,8 @@ method to edit. For modules, open the main source file. The module needs to be l
98
108
The editor can be changed by setting `JULIA_EDITOR`, `VISUAL` or `EDITOR` as an environment
99
109
variable.
100
110
"""
101
- edit (f) = edit (functionloc (f)... )
102
- edit (f, @nospecialize t) = edit (functionloc (f,t)... )
111
+ edit (f) = edit (functionloc_stdlib_workaround (f)... )
112
+ edit (f, @nospecialize t) = edit (functionloc_stdlib_workaround (f,t)... )
103
113
edit (file, line:: Integer ) = error (" could not find source file for function" )
104
114
edit (m:: Module ) = edit (pathof (m))
105
115
@@ -134,6 +144,6 @@ less(file::AbstractString) = less(file, 1)
134
144
Show the definition of a function using the default pager, optionally specifying a tuple of
135
145
types to indicate which method to see.
136
146
"""
137
- less (f) = less (functionloc (f)... )
138
- less (f, @nospecialize t) = less (functionloc (f,t)... )
147
+ less (f) = less (functionloc_stdlib_workaround (f)... )
148
+ less (f, @nospecialize t) = less (functionloc_stdlib_workaround (f,t)... )
139
149
less (file, line:: Integer ) = error (" could not find source file for function" )
0 commit comments