diff --git a/analysis/src/Uri2.ml b/analysis/src/Uri2.ml index 437632a99..6c0617e65 100644 --- a/analysis/src/Uri2.ml +++ b/analysis/src/Uri2.ml @@ -36,7 +36,11 @@ end = struct let toPath {path} = path - let toString {uri} = if !stripPath then Filename.basename uri else uri + let toString {uri} = + if !stripPath then + let n = Str.search_forward (Str.regexp "test") uri 0 in + String.sub uri n (String.length uri - n) + else uri end include Uri diff --git a/analysis/tests/src/expected/Completion.res.txt b/analysis/tests/src/expected/Completion.res.txt index dd3c1bd8c..fe5dbd8d0 100644 --- a/analysis/tests/src/expected/Completion.res.txt +++ b/analysis/tests/src/expected/Completion.res.txt @@ -459,82 +459,82 @@ DocumentSymbol tests/src/Completion.res { "name": "MyList", "kind": 2, - "location": {"uri": "Completion.res", "range": {"start": {"line": 0, "character": 7}, "end": {"line": 0, "character": 25}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 0, "character": 7}, "end": {"line": 0, "character": 25}}} }, { "name": "Dep", "kind": 2, - "location": {"uri": "Completion.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 11, "character": 1}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 11, "character": 1}}} }, { "name": "customDouble", "kind": 12, - "location": {"uri": "Completion.res", "range": {"start": {"line": 7, "character": 2}, "end": {"line": 8, "character": 30}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 7, "character": 2}, "end": {"line": 8, "character": 30}}} }, { "name": "Lib", "kind": 2, - "location": {"uri": "Completion.res", "range": {"start": {"line": 15, "character": 7}, "end": {"line": 18, "character": 1}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 15, "character": 7}, "end": {"line": 18, "character": 1}}} }, { "name": "foo", "kind": 12, - "location": {"uri": "Completion.res", "range": {"start": {"line": 16, "character": 6}, "end": {"line": 16, "character": 9}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 16, "character": 6}, "end": {"line": 16, "character": 9}}} }, { "name": "next", "kind": 12, - "location": {"uri": "Completion.res", "range": {"start": {"line": 17, "character": 6}, "end": {"line": 17, "character": 10}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 17, "character": 6}, "end": {"line": 17, "character": 10}}} }, { "name": "op", "kind": 13, - "location": {"uri": "Completion.res", "range": {"start": {"line": 26, "character": 4}, "end": {"line": 26, "character": 6}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 26, "character": 4}, "end": {"line": 26, "character": 6}}} }, { "name": "ForAuto", "kind": 2, - "location": {"uri": "Completion.res", "range": {"start": {"line": 30, "character": 7}, "end": {"line": 34, "character": 1}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 30, "character": 7}, "end": {"line": 34, "character": 1}}} }, { "name": "t", "kind": 26, - "location": {"uri": "Completion.res", "range": {"start": {"line": 31, "character": 2}, "end": {"line": 31, "character": 14}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 31, "character": 2}, "end": {"line": 31, "character": 14}}} }, { "name": "abc", "kind": 12, - "location": {"uri": "Completion.res", "range": {"start": {"line": 32, "character": 6}, "end": {"line": 32, "character": 9}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 32, "character": 6}, "end": {"line": 32, "character": 9}}} }, { "name": "abd", "kind": 12, - "location": {"uri": "Completion.res", "range": {"start": {"line": 33, "character": 6}, "end": {"line": 33, "character": 9}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 33, "character": 6}, "end": {"line": 33, "character": 9}}} }, { "name": "fa", "kind": 13, - "location": {"uri": "Completion.res", "range": {"start": {"line": 36, "character": 4}, "end": {"line": 36, "character": 6}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 36, "character": 4}, "end": {"line": 36, "character": 6}}} }, { "name": "O", "kind": 2, - "location": {"uri": "Completion.res", "range": {"start": {"line": 41, "character": 7}, "end": {"line": 47, "character": 1}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 41, "character": 7}, "end": {"line": 47, "character": 1}}} }, { "name": "Comp", "kind": 2, - "location": {"uri": "Completion.res", "range": {"start": {"line": 42, "character": 9}, "end": {"line": 46, "character": 3}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 42, "character": 9}, "end": {"line": 46, "character": 3}}} }, { "name": "make", "kind": 12, - "location": {"uri": "Completion.res", "range": {"start": {"line": 44, "character": 8}, "end": {"line": 44, "character": 12}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 44, "character": 8}, "end": {"line": 44, "character": 12}}} }, { "name": "zzz", "kind": 13, - "location": {"uri": "Completion.res", "range": {"start": {"line": 49, "character": 4}, "end": {"line": 49, "character": 7}}} + "location": {"uri": "tests/src/Completion.res", "range": {"start": {"line": 49, "character": 4}, "end": {"line": 49, "character": 7}}} } ] diff --git a/analysis/tests/src/expected/Definition.res.txt b/analysis/tests/src/expected/Definition.res.txt index d88c9782a..bd124f501 100644 --- a/analysis/tests/src/expected/Definition.res.txt +++ b/analysis/tests/src/expected/Definition.res.txt @@ -1,8 +1,8 @@ Definition tests/src/Definition.res 2:8 -{"uri": "Definition.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 6}}} +{"uri": "tests/src/Definition.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 6}}} Definition tests/src/Definition.res 10:23 -{"uri": "Definition.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 6, "character": 13}}} +{"uri": "tests/src/Definition.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 6, "character": 13}}} Hover tests/src/Definition.res 14:14 {"contents": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```\n\n [List.map f [a1; ...; an]] applies function [f] to [a1, ..., an],\n and builds the list [[f a1; ...; f an]]\n with the results returned by [f]. Not tail-recursive. "} diff --git a/analysis/tests/src/expected/Hover.res.txt b/analysis/tests/src/expected/Hover.res.txt index 8302e089c..30dd08ee4 100644 --- a/analysis/tests/src/expected/Hover.res.txt +++ b/analysis/tests/src/expected/Hover.res.txt @@ -35,7 +35,7 @@ Hover tests/src/Hover.res 52:7 {"contents": "```rescript\nmodule Logger = {\n let log: string => unit\n}\n```"} Definition tests/src/Hover.res 58:14 -{"uri": "Hover.res", "range": {"start": {"line": 47, "character": 12}, "end": {"line": 47, "character": 18}}} +{"uri": "tests/src/Hover.res", "range": {"start": {"line": 47, "character": 12}, "end": {"line": 47, "character": 18}}} Hover tests/src/Hover.res 62:9 {"contents": "```rescript\nmodule IdDefinedTwice = {\n let y: int\n let _x: int\n}\n```"} diff --git a/analysis/tests/src/expected/Jsx.res.txt b/analysis/tests/src/expected/Jsx.res.txt index 2af23248e..fd4f45bc7 100644 --- a/analysis/tests/src/expected/Jsx.res.txt +++ b/analysis/tests/src/expected/Jsx.res.txt @@ -1,5 +1,5 @@ Definition tests/src/Jsx.res 5:9 -{"uri": "Jsx.res", "range": {"start": {"line": 2, "character": 6}, "end": {"line": 2, "character": 10}}} +{"uri": "tests/src/Jsx.res", "range": {"start": {"line": 2, "character": 6}, "end": {"line": 2, "character": 10}}} Complete tests/src/Jsx.res 7:2 [{ diff --git a/analysis/tests/src/expected/Patterns.res.txt b/analysis/tests/src/expected/Patterns.res.txt index e0e13a62b..ca3018f38 100644 --- a/analysis/tests/src/expected/Patterns.res.txt +++ b/analysis/tests/src/expected/Patterns.res.txt @@ -1,15 +1,15 @@ Definition tests/src/Patterns.res 20:10 -{"uri": "Patterns.res", "range": {"start": {"line": 3, "character": 7}, "end": {"line": 3, "character": 10}}} +{"uri": "tests/src/Patterns.res", "range": {"start": {"line": 3, "character": 7}, "end": {"line": 3, "character": 10}}} Definition tests/src/Patterns.res 25:11 -{"uri": "Patterns.res", "range": {"start": {"line": 9, "character": 7}, "end": {"line": 9, "character": 11}}} +{"uri": "tests/src/Patterns.res", "range": {"start": {"line": 9, "character": 7}, "end": {"line": 9, "character": 11}}} Definition tests/src/Patterns.res 28:11 -{"uri": "Patterns.res", "range": {"start": {"line": 11, "character": 7}, "end": {"line": 11, "character": 8}}} +{"uri": "tests/src/Patterns.res", "range": {"start": {"line": 11, "character": 7}, "end": {"line": 11, "character": 8}}} Definition tests/src/Patterns.res 31:11 -{"uri": "Patterns.res", "range": {"start": {"line": 15, "character": 9}, "end": {"line": 15, "character": 11}}} +{"uri": "tests/src/Patterns.res", "range": {"start": {"line": 15, "character": 9}, "end": {"line": 15, "character": 11}}} Definition tests/src/Patterns.res 34:11 -{"uri": "Patterns.res", "range": {"start": {"line": 17, "character": 11}, "end": {"line": 17, "character": 16}}} +{"uri": "tests/src/Patterns.res", "range": {"start": {"line": 17, "character": 11}, "end": {"line": 17, "character": 16}}} diff --git a/analysis/tests/src/expected/References.res.txt b/analysis/tests/src/expected/References.res.txt index d893cd1e4..bc422bc70 100644 --- a/analysis/tests/src/expected/References.res.txt +++ b/analysis/tests/src/expected/References.res.txt @@ -1,8 +1,8 @@ References tests/src/References.res 0:4 [ -{"uri": "Cross.res", "range": {"start": {"line": 0, "character": 26}, "end": {"line": 0, "character": 27}}}, -{"uri": "References.res", "range": {"start": {"line": 7, "character": 8}, "end": {"line": 7, "character": 9}}}, -{"uri": "References.res", "range": {"start": {"line": 3, "character": 8}, "end": {"line": 3, "character": 9}}}, -{"uri": "References.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} +{"uri": "tests/src/Cross.res", "range": {"start": {"line": 0, "character": 26}, "end": {"line": 0, "character": 27}}}, +{"uri": "tests/src/References.res", "range": {"start": {"line": 7, "character": 8}, "end": {"line": 7, "character": 9}}}, +{"uri": "tests/src/References.res", "range": {"start": {"line": 3, "character": 8}, "end": {"line": 3, "character": 9}}}, +{"uri": "tests/src/References.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} ]