Skip to content

Commit

Permalink
resolve nits
Browse files Browse the repository at this point in the history
Summary: Resolving nits from D49383381. I didn't see them since I started the land before they were there.

Reviewed By: inseokhwang

Differential Revision: D49776594

fbshipit-source-id: 387e55afcc97ef58c5592075c0c82984f6a0bb67
  • Loading branch information
kinto0 authored and facebook-github-bot committed Oct 2, 2023
1 parent 0d752d1 commit d1690c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
3 changes: 2 additions & 1 deletion source/code_navigation_server/requestHandler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ let get_modules ~module_tracker ~build_system path =
~module_tracker
~lookup_artifact:(BuildSystem.lookup_artifact build_system)
with
(* In case there's no build system artifacts for this source, lookup the module as if it's built
by a no-op build system (using normal source path mapping) *)
| [] ->
(* Lookup the module as if it's built by a no-op build system *)
Server.PathLookup.modules_of_source_path
source_path
~module_tracker
Expand Down
13 changes: 3 additions & 10 deletions source/code_navigation_server/test/buildSystemTest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ let test_build_system_path_lookup context =
let root = ScratchProject.source_root_of project in
let path_a = PyrePath.create_relative ~root ~relative:"a.py" |> PyrePath.absolute in
let path_b = PyrePath.create_relative ~root ~relative:"b.py" |> PyrePath.absolute in
let path_c = PyrePath.create_relative ~root ~relative:"c.py" |> PyrePath.absolute in
let expected_error =
Analysis.AnalysisError.Instantiated.of_yojson
(`Assoc
Expand Down Expand Up @@ -290,8 +291,7 @@ let test_build_system_path_lookup context =
Query
(Query.LocationOfDefinition { path = path_a; client_id; position = position 2 12 }))
~kind:"FileNotOpened";
(* Try open both `a.py` (no artifact path), `b.py` (artifact path), and `c.py`
(nonexistent) *)
(* Try open `a.py` (no artifact path), `b.py` (artifact path), and `c.py` (nonexistent) *)
ScratchProject.ClientConnection.assert_response
~request:
Request.(Command (Command.FileOpened { path = path_a; content = None; client_id }))
Expand All @@ -302,14 +302,7 @@ let test_build_system_path_lookup context =
~expected:Response.Ok;
ScratchProject.ClientConnection.assert_error_response
~request:
Request.(
Command
(Command.FileOpened
{
path = PyrePath.create_relative ~root ~relative:"c.py" |> PyrePath.absolute;
content = None;
client_id;
}))
Request.(Command (Command.FileOpened { path = path_c; content = None; client_id }))
~kind:"ModuleNotTracked";
(* Server should be aware of `b.py` on type error query *)
ScratchProject.ClientConnection.assert_response
Expand Down

0 comments on commit d1690c4

Please sign in to comment.