Skip to content

Remove workaround for canonicalize function in tests #992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- Fix highlighting of other languages being affected by rescript-vscode. https://github.com/rescript-lang/rescript-vscode/pull/973
- Use canonicalized URIs/paths for jump to definition. https://github.com/rescript-lang/rescript-vscode/pull/982
- Fix JSX prop special case in end of JSX element. https://github.com/rescript-lang/rescript-vscode/pull/984
- preserve URI format in canonicalizeUri. https://github.com/rescript-lang/rescript-vscode/pull/990
- Remove workaround for canonicalize function in tests https://github.com/rescript-lang/rescript-vscode/pull/992

#### :nail_care: Polish

Expand Down
4 changes: 1 addition & 3 deletions analysis/bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ let main () =
(Json.escape (CreateInterface.command ~path ~cmiFile))
| [_; "format"; path] ->
Printf.printf "\"%s\"" (Json.escape (Commands.format ~path))
| [_; "test"; path] ->
Cfg.isTestMode := true;
Commands.test ~path
| [_; "test"; path] -> Commands.test ~path
| args when List.mem "-h" args || List.mem "--help" args -> prerr_endline help
| _ ->
prerr_endline help;
Expand Down
2 changes: 0 additions & 2 deletions analysis/src/Cfg.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
let debugFollowCtxPath = ref false

let isDocGenFromCompiler = ref false

let isTestMode = ref false
6 changes: 2 additions & 4 deletions analysis/src/Files.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,5 @@ let classifySourceFile path =
else Other

let canonicalizeUri uri =
if Cfg.isTestMode.contents then uri |> Uri.toString
else
let path = Uri.toPath uri in
path |> Unix.realpath |> Uri.fromPath |> Uri.toString
let path = Uri.toPath uri in
path |> Unix.realpath |> Uri.fromPath |> Uri.toString
Loading