Skip to content

Commit ae50bd4

Browse files
committed
Towards adding a debug command.
1 parent 3709b1b commit ae50bd4

File tree

4 files changed

+78
-1
lines changed

4 files changed

+78
-1
lines changed

analysis/.depend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ src/Cmt.cmx : src/Utils.cmx src/Uri2.cmx src/SharedTypes.cmx \
44
src/ProcessCmt.cmx src/Packages.cmx src/FindFiles.cmx src/BuildSystem.cmx
55
src/Commands.cmx : src/Utils.cmx src/Uri2.cmx src/SharedTypes.cmx \
66
src/Shared.cmx src/References.cmx src/Protocol.cmx src/NewCompletions.cmx \
7-
src/Hover.cmx src/Files.cmx src/Cmt.cmx
7+
src/Log.cmx src/Hover.cmx src/Files.cmx src/Cmt.cmx
88
src/Files.cmx :
99
src/FindFiles.cmx : src/Utils.cmx src/SharedTypes.cmx \
1010
src/ModuleResolution.cmx src/Log.cmx src/vendor/Json.cmx src/Infix.cmx \

analysis/src/Commands.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ let test ~path =
296296
let col = mlen - 1 in
297297
if mlen >= 3 then (
298298
(match String.sub rest 0 3 with
299+
| "deb" ->
300+
Log.spamError := true;
301+
print_endline
302+
("Debug " ^ path ^ " " ^ string_of_int line ^ ":"
303+
^ string_of_int col);
304+
definition ~path ~line ~col
299305
| "def" ->
300306
print_endline
301307
("Definition " ^ path ^ " " ^ string_of_int line ^ ":"

analysis/tests/src/Debug.res

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
let m = Belt.List.map
2+
// ^deb
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Debug tests/src/Debug.res 0:4
2+
📣 📣 NEW BSB PACKAGE 📣 📣
3+
- location: tests
4+
Deps @rescript/react
5+
Dep loc tests/node_modules/@rescript/react/bsconfig.json
6+
Compiled base: tests/node_modules/@rescript/react/lib/bs
7+
Source directories: tests/node_modules/@rescript/react/./src - tests/node_modules/@rescript/react/./src/legacy
8+
Source files found: tests/node_modules/@rescript/react/./src/ReactEvent.resi : tests/node_modules/@rescript/react/./src/RescriptReactErrorBoundary.resi : tests/node_modules/@rescript/react/./src/RescriptReactErrorBoundary.res : tests/node_modules/@rescript/react/./src/ReactDOMStyle.res : tests/node_modules/@rescript/react/./src/ReactTestUtils.resi : tests/node_modules/@rescript/react/./src/legacy/ReactDOMRe.res : tests/node_modules/@rescript/react/./src/legacy/ReasonReact.res : tests/node_modules/@rescript/react/./src/RescriptReactRouter.res : tests/node_modules/@rescript/react/./src/RescriptReactRouter.resi : tests/node_modules/@rescript/react/./src/ReactDOMServer.res : tests/node_modules/@rescript/react/./src/ReactEvent.res : tests/node_modules/@rescript/react/./src/ReactDOM.res : tests/node_modules/@rescript/react/./src/React.res : tests/node_modules/@rescript/react/./src/ReactTestUtils.res
9+
Adding intf tests/node_modules/@rescript/react/./src/ReactEvent.resi
10+
Adding intf tests/node_modules/@rescript/react/./src/RescriptReactErrorBoundary.resi
11+
Adding intf tests/node_modules/@rescript/react/./src/ReactTestUtils.resi
12+
Adding intf tests/node_modules/@rescript/react/./src/RescriptReactRouter.resi
13+
Got source directories src
14+
Source directories: tests/src
15+
Source files found: tests/src/DefinitionWithInterface.res : tests/src/Div.res : tests/src/Definition.res : tests/src/Debug.res : tests/src/RenameWithInterface.res : tests/src/ReferencesWithInterface.resi : tests/src/Jsx.resi : tests/src/DefinitionWithInterface.resi : tests/src/Rename.res : tests/src/Auto.res : tests/src/RenameWithInterface.resi : tests/src/RecModules.res : tests/src/Hover.res : tests/src/TypeDefinition.res : tests/src/Completion.res : tests/src/Cross.res : tests/src/Patterns.res : tests/src/RecordCompletion.res : tests/src/Component.resi : tests/src/Jsx.res : tests/src/References.res : tests/src/Component.res : tests/src/Fragment.res : tests/src/ReferencesWithInterface.res
16+
Adding intf tests/src/ReferencesWithInterface.resi
17+
Adding intf tests/src/Jsx.resi
18+
Adding intf tests/src/DefinitionWithInterface.resi
19+
Adding intf tests/src/RenameWithInterface.resi
20+
Adding intf tests/src/Component.resi
21+
-- All project files found: 19
22+
DefinitionWithInterface
23+
Both
24+
Div
25+
impl tests/lib/bs/./src/Div.cmt
26+
Definition
27+
impl tests/lib/bs/./src/Definition.cmt
28+
Debug
29+
impl tests/lib/bs/./src/Debug.cmt
30+
RenameWithInterface
31+
Both
32+
Rename
33+
impl tests/lib/bs/./src/Rename.cmt
34+
Auto
35+
impl tests/lib/bs/./src/Auto.cmt
36+
RecModules
37+
impl tests/lib/bs/./src/RecModules.cmt
38+
Hover
39+
impl tests/lib/bs/./src/Hover.cmt
40+
TypeDefinition
41+
impl tests/lib/bs/./src/TypeDefinition.cmt
42+
Completion
43+
impl tests/lib/bs/./src/Completion.cmt
44+
Cross
45+
impl tests/lib/bs/./src/Cross.cmt
46+
Patterns
47+
impl tests/lib/bs/./src/Patterns.cmt
48+
RecordCompletion
49+
impl tests/lib/bs/./src/RecordCompletion.cmt
50+
Jsx
51+
Both
52+
References
53+
impl tests/lib/bs/./src/References.cmt
54+
Component
55+
Both
56+
Fragment
57+
impl tests/lib/bs/./src/Fragment.cmt
58+
ReferencesWithInterface
59+
Both
60+
Dependency dirs tests/node_modules/@rescript/react/lib/bs/./src tests/node_modules/@rescript/react/lib/bs/./src/legacy
61+
Opens from bsconfig:
62+
locItems:
63+
0:4-0:5 Typed m (Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b> (Definition Value)
64+
[ref] Trying to find a defintion for a definition
65+
[ref] Declared
66+
[ref] exported, looking for alternate Debug
67+
[ref] paths for Debug
68+
null
69+

0 commit comments

Comments
 (0)