Skip to content

Commit 5e10c03

Browse files
committed
Always track symbol-links
1 parent c79edf1 commit 5e10c03

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
5+
* `CHG` Always track symbol-links
56
* `CHG` Modified the `ResolveRequire` function to pass the source URI as a third argument.
67
* `CHG` Improved the output of test failures during development
78
* `FIX` Fix type inference for bitwise operators (`<<`, `>>`, `&`, `|`, `~`) on integer variables

script/files.lua

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -80,39 +80,7 @@ end
8080
---@param uri uri
8181
---@return uri
8282
function m.getRealUri(uri)
83-
if platform.os ~= 'windows' then
84-
return furi.normalize(uri)
85-
end
86-
if not furi.isValid(uri) then
87-
return uri
88-
end
89-
local filename = furi.decode(uri)
90-
-- normalize uri
91-
uri = furi.encode(filename)
92-
local path = fs.path(filename)
93-
local suc, exists = pcall(fs.exists, path)
94-
if not suc or not exists then
95-
return uri
96-
end
97-
local suc, res = pcall(fs.canonical, path)
98-
if not suc then
99-
return uri
100-
end
101-
filename = res:string()
102-
local ruri = furi.encode(filename)
103-
if uri == ruri then
104-
return ruri
105-
end
106-
local real = getRealParent(path:parent_path()) / res:filename()
107-
ruri = furi.encode(real:string())
108-
if uri == ruri then
109-
return ruri
110-
end
111-
if not uriMap[uri] then
112-
uriMap[uri] = true
113-
log.warn(('Fix real file uri: %s -> %s'):format(uri, ruri))
114-
end
115-
return ruri
83+
return furi.normalize(uri)
11684
end
11785

11886
--- 打开文件

0 commit comments

Comments
 (0)