Skip to content

Commit 4dd2224

Browse files
authored
Add tests to verify that jump-to-definition still works with previous ocaml versions (#369)
1 parent d96c84c commit 4dd2224

File tree

45 files changed

+1919
-63
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1919
-63
lines changed

.ci/build-platform.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ jobs:
1717
- template: utils/use-node.yml
1818
- template: utils/use-esy.yml
1919
- template: utils/restore-build-cache.yml
20-
- script: "esy install"
21-
displayName: "esy install"
22-
- script: "esy build"
23-
displayName: "esy build"
24-
# - script: "esy test"
25-
# displayName: "Test command"
20+
- script: "esy"
21+
displayName: "esy install & build"
22+
- bash: ./runtests.sh
23+
displayName: "Run some tests"
2624
- template: utils/publish-build-cache.yml
27-
- bash: ./_build/default/src/analyze_example_tests/ExamplesTests.exe
28-
- bash: ./_build/default/util_tests/UtilTests.exe
2925
- bash: mkdir -p rls-release
30-
- bash: cp _build/default/bin/Bin.exe rls-release/reason-language-server.exe
26+
- bash: esy cp-bin
27+
- bash: cp bin.exe rls-release/reason-language-server.exe
3128
- task: PublishBuildArtifacts@1
3229
displayName: 'Upload binary'
3330
inputs:

.github/workflows/main.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
on: [push, pull_request]
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
28

39
jobs:
410
build:
@@ -20,14 +26,8 @@ jobs:
2026
- name: install esy
2127
run: |
2228
npm install -g esy
23-
- name: Install dependencies
24-
run: |
25-
esy install
26-
- name: Building reason-langage-server
27-
run: |
28-
esy build
29-
env:
30-
CI: true
31-
- name: Building all in reason-langage-server
32-
run: |
33-
esy build dune build @all
29+
- name: Esy
30+
run: esy
31+
- name: Running some tests
32+
run: ./runtests.sh
33+
shell: bash

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ bsb_modules
2525
_esy/
2626
bin.exe
2727
ExamplesTests.exe
28+
AllTests.exe

core/References.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
open SharedTypes;
33

4-
let debugReferences = ref(false);
4+
let debugReferences = ref(true);
55

66
let maybeLog = m => {
77
if (debugReferences^) {

editor-extensions/vscode/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
{
4040
"command": "reason-language-server.create_interface",
4141
"title": "Reason: Create an interface file for this implementation file."
42+
},
43+
{
44+
"command": "reason-language-server.dump_file_data",
45+
"title": "Reason: dump data on the current file"
4246
}
4347
],
4448
"snippets": [

editor-extensions/vscode/src/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,24 @@ function activate(context) {
274274

275275
vscode.commands.registerCommand('reason-language-server.show_ppxed_source', showPpxedSource);
276276

277+
vscode.commands.registerCommand('reason-language-server.dump_file_data', () => {
278+
if (!client) {
279+
return vscode.window.showInformationMessage('Language server not running');
280+
}
281+
const editor = vscode.window.activeTextEditor;
282+
if (!editor) {
283+
return vscode.window.showInformationMessage('No active editor');
284+
}
285+
if (editor.document.languageId !== 'ocaml' && editor.document.languageId !== 'reason') {
286+
return vscode.window.showInformationMessage('Not an OCaml or Reason file');
287+
}
288+
client.sendRequest("custom:reasonLanguageServer/dumpFileData", {
289+
"textDocument": {
290+
"uri": editor.document.uri.with({scheme: 'file'}).toString(),
291+
},
292+
})
293+
});
294+
277295
const showAst = () => {
278296
if (!client) {
279297
return vscode.window.showInformationMessage('Language server not running');

examples/example-esy-dune-project/bin/Hello.re

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ let l = More.outer + More.n + Other.inner;
1111

1212
let n = More.n;
1313

14+
let x = 10;
15+
let y = x;
16+
1417
More.party;
1518
string_of_bool;
1619

old_ocamls/407/dune-project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(lang dune 1.6)

old_ocamls/407/esy.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"devDependencies": {
3+
"ocaml": "~4.7",
4+
"@esy-ocaml/reason": "*"
5+
}
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# Set eol to LF so files aren't converted to CRLF-eol on Windows.
3+
* text eol=lf

old_ocamls/407/esy.lock/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# Reset any possible .gitignore, we want all esy.lock to be un-ignored.
3+
!*

0 commit comments

Comments
 (0)