Repository navigation
refactor: migrate FilePath/NormalizedFilePath to OsPath/NormalizedOsPath #3046 - #5118
blackheaven wants to merge 8 commits into
Conversation
|
Not sure why everyone is involved, sorry |
ef0dd8d to
9e7da21
Compare
…askell#3046 - New type NormalizedOsPath (OsPath-backed, cached NormalizedUri) in hls-plugin-api/src/Ide/Types/Location.hs; ghcide's Development.IDE.Types.Location re-exports it. - Same function names, new types: toNormalizedFilePath', fromNormalizedFilePath, uriToFilePath' (-> Maybe OsPath), uriToNormalizedOsPath (total on client input), filePathToUri' (O(1)), fromUri, encodeOsPath/decodeOsPath (filesystem encoding; CPP for the filepath 1.4.3xx double-encoding API on GHC <= 9.8). - lsp NormalizedFilePath re-exports removed; lsp wire stays Text. - GHC API / hiedb / hie-bios / Process / Temp boundaries keep FilePath via fromNormalizedFilePath. - ghcide core, session-loader, plugin-api, test-utils, all plugins, tests migrated. cabal bounds: filepath >=1.4.100. Verified: cabal build all (GHC 9.8.4); ghcide-tests, func-test, refactor/hlint/cabal/eval/rename plugin suites; bench edit within noise; peak RSS unchanged; raw-byte path behavior identical to baseline.
9e7da21 to
17e896a
Compare
systemFsEncoding and decodeOsPath in Ide.Types.Location need unsafePerformIO to cache the file-system encoding, same rationale as the existing Ide.Types allowlist entry.
|
CI failure triage for windows-9.12
|
|
Latest errors: I'll trigger it again when I get feedback or it's approved. |
|
Should we perhaps avoid many of the changes and rather change the Internals of |
Address fendor's review on haskell#5118: avoid introducing a new exported type name; keep NormalizedFilePath and only change its internals to OsPath. Mechanical rename back from NormalizedOsPath, plus hiding lists for lsp-types' own NormalizedFilePath/uriToNormalizedFilePath. Also commit test/testdata/Property golden data required by hls-plugin-api tests (previously untracked).
Address fendor's review on haskell#5118: avoid introducing a new exported type name; keep NormalizedFilePath and only change its internals to OsPath. Mechanical rename back from NormalizedOsPath, plus hiding lists for lsp-types' own NormalizedFilePath/uriToNormalizedFilePath. Also commit test/testdata/Property golden data required by hls-plugin-api tests (previously untracked).
c38ff8d to
7f305c5
Compare
Done, though it did not impact much the final diff. Please, let me know what I should improve next. |
My MuniHac contribution to close #3046
Note that there is still a legacy callsite I'll handle when haskell/lsp#646 is merged.