This repository was archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Migrate to ocamlmerlin-lsp #269
Open
rusty-key
wants to merge
34
commits into
reasonml-editor:master
Choose a base branch
from
rusty-key:ocamlmerlin-lsp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
4637b8a
WIP: support for ocamlmerlin-lsp
andreypopp 1072823
use merlin-lsp for all projects
aec1eac
remove ols-related code
a4c1821
add formatters
d52fee6
use temp files to better handle large files
57590da
fix formatting
690f2a4
revert unrelated change
c705687
tweak options format
32fe6d3
handle possible errors
798219e
remove debug
8bd13e5
remove unsupported settings
7000de8
prebuild merlin-lsp/merlin-reason and use them for reason projects
8f44e4e
use platform’s tmp dir
ce09262
fix lsp binaries
c6d6408
remove ocamlfind dependency
bf91e25
get rid of custom paths
280112c
add some checks
8e11395
use esy for formatters
9ae3159
fix code style
be95b57
add local opam switch support
Khady 9e7085d
Merge pull request #1 from Khady/opam-switch-support
b06b7ec
add restart ls command
9c7682d
fix refmt’s temp file extension
6a75a9a
remove debug
7e1dc9d
add esy.json generation for bs projects
a6c0889
add resolutions for 4.02
d5845d8
ignore packaged extensions
6c78709
init merlin-lsp when it is installed
c95bbc2
"simplify" extension setup
c7c77e4
pass ocamlmerlin-reason path
520bdd4
describe 4.02 setup
2b66c0e
update readme
be6cac2
remove unused utils
c759a28
fix version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,138 +16,57 @@ | |
| "engines": { | ||
| "vscode": "^1.21.0" | ||
| }, | ||
| "categories": ["Formatters", "Programming Languages", "Linters", "Snippets"], | ||
| "keywords": ["ocaml", "reason", "bucklescript", "reasonml", "merlin"], | ||
| "categories": [ | ||
| "Formatters", | ||
| "Programming Languages", | ||
| "Linters", | ||
| "Snippets" | ||
| ], | ||
| "keywords": [ | ||
| "ocaml", | ||
| "reason", | ||
| "bucklescript", | ||
| "reasonml", | ||
| "merlin" | ||
| ], | ||
| "icon": "assets/logo.png", | ||
| "activationEvents": ["onLanguage:ocaml", "onLanguage:reason"], | ||
| "activationEvents": [ | ||
| "onLanguage:ocaml", | ||
| "onLanguage:reason" | ||
| ], | ||
| "main": "./out/src/extension", | ||
| "contributes": { | ||
| "commands": [ | ||
| { | ||
| "command": "reason.caseSplit", | ||
| "title": "Reason: Case Split" | ||
| }, | ||
| { | ||
| "command": "reason.showMerlinFiles", | ||
| "title": "Reason: Show Merlin Files" | ||
| }, | ||
| { | ||
| "command": "reason.showAvailableLibraries", | ||
| "title": "Reason: Show Libraries Available via Dependencies" | ||
| }, | ||
| { | ||
| "command": "reason.showProjectEnv", | ||
| "title": "Reason: Show Environment" | ||
| } | ||
| ], | ||
| "configuration": { | ||
| "type": "object", | ||
| "title": "Reason configuration", | ||
| "properties": { | ||
| "reason.codelens.unicode": { | ||
| "type": "boolean", | ||
| "default": true, | ||
| "description": "Enable the use of unicode symbols in codelens." | ||
| }, | ||
| "reason.codelens.enabled": { | ||
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Specifies whether the code lens is shown." | ||
| }, | ||
| "reason.debounce.linter": { | ||
| "oneOf": [ | ||
| { | ||
| "type": "integer" | ||
| }, | ||
| { | ||
| "enum": ["Infinity"] | ||
| } | ||
| ], | ||
| "default": 500, | ||
| "description": | ||
| "How long to idle (in milliseconds) after keypresses before refreshing linter diagnostics. Smaller values refresh diagnostics more quickly." | ||
| }, | ||
| "reason.diagnostics.tools": { | ||
| "type": "array", | ||
| "items": { | ||
| "enum": ["merlin", "bsb"] | ||
| }, | ||
| "default": ["merlin"], | ||
| "maxItems": 2, | ||
| "uniqueItems": true, | ||
| "description": | ||
| "Specifies which tool or tools will be used to get diagnostics. If you choose both \"merlin\" and \"bsb\", merlin will be used while editing and bsb when saving." | ||
| }, | ||
| "reason.format.width": { | ||
| "type": ["number", null], | ||
| "type": [ | ||
| "number", | ||
| null | ||
| ], | ||
| "default": null, | ||
| "description": "Set the width of lines when formatting code with refmt" | ||
| }, | ||
| "reason.path.bsb": { | ||
| "type": "string", | ||
| "default": "./node_modules/bs-platform/lib/bsb.exe", | ||
| "description": "The path to the `bsb` binary." | ||
| }, | ||
| "reason.path.ocamlfind": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jordwalke Heads up: this will remove the APIs for introspecting environments that were added in https://github.com/freebroccolo/ocaml-language-server/pull/68. |
||
| "type": "string", | ||
| "default": "ocamlfind", | ||
| "description": "The path to the `ocamlfind` binary." | ||
| }, | ||
| "reason.path.esy": { | ||
|
||
| "type": "string", | ||
| "default": "esy", | ||
| "description": "The path to the `esy` binary." | ||
| }, | ||
| "reason.path.env": { | ||
| "type": "string", | ||
| "default": "env", | ||
| "description": | ||
| "The path to the `env` command which prints the language server environment for debugging editor issues." | ||
| }, | ||
| "reason.path.ocamlmerlin": { | ||
| "type": "string", | ||
| "default": "ocamlmerlin", | ||
| "description": "The path to the `ocamlmerlin` binary." | ||
| }, | ||
| "reason.path.ocpindent": { | ||
| "reason.path.ocamlformat": { | ||
| "type": "string", | ||
| "default": "ocp-indent", | ||
| "description": "The path to the `ocp-indent` binary." | ||
| "default": "ocamlformat", | ||
| "description": "The path to the `ocamlformat` binary." | ||
| }, | ||
| "reason.path.opam": { | ||
| "reason.path.ocamlmerlin-lsp": { | ||
| "type": "string", | ||
| "default": "opam", | ||
| "description": "The path to the `opam` binary." | ||
| }, | ||
| "reason.path.rebuild": { | ||
| "type": "string", | ||
| "default": "rebuild", | ||
| "description": "The path to the `rebuild` binary." | ||
| "default": null, | ||
| "description": "The path to the `ocamlmerlin-lsp` binary." | ||
| }, | ||
| "reason.path.refmt": { | ||
| "type": "string", | ||
| "default": "refmt", | ||
| "description": "The path to the `refmt` binary." | ||
| }, | ||
| "reason.path.refmterr": { | ||
| "type": "string", | ||
| "default": "refmterr", | ||
| "description": "The path to the `refmterr` binary." | ||
| }, | ||
| "reason.path.rtop": { | ||
| "type": "string", | ||
| "default": "rtop", | ||
| "description": "The path to the `rtop` binary." | ||
| }, | ||
| "reason.server.languages": { | ||
| "type": "array", | ||
| "items": { | ||
| "enum": ["ocaml", "reason"] | ||
| }, | ||
| "default": ["ocaml", "reason"], | ||
| "maxItems": 2, | ||
| "uniqueItems": true, | ||
| "description": "The list of languages enable support for in the language server." | ||
| } | ||
| } | ||
| }, | ||
|
|
@@ -205,15 +124,19 @@ | |
| { | ||
| "scopeName": "markdown.reason.codeblock", | ||
| "path": "./syntaxes/reason-markdown-codeblock.json", | ||
| "injectTo": ["text.html.markdown"], | ||
| "injectTo": [ | ||
| "text.html.markdown" | ||
| ], | ||
| "embeddedLanguages": { | ||
| "meta.embedded.block.reason": "reason" | ||
| } | ||
| }, | ||
| { | ||
| "scopeName": "markdown.ocaml.codeblock", | ||
| "path": "./syntaxes/ocaml-markdown-codeblock.json", | ||
| "injectTo": ["text.html.markdown"], | ||
| "injectTo": [ | ||
| "text.html.markdown" | ||
| ], | ||
| "embeddedLanguages": { | ||
| "meta.embedded.block.ocaml": "ocaml" | ||
| } | ||
|
|
@@ -222,8 +145,13 @@ | |
| "languages": [ | ||
| { | ||
| "id": "ocaml", | ||
| "aliases": ["OCaml"], | ||
| "extensions": [".ml", ".mli"], | ||
| "aliases": [ | ||
| "OCaml" | ||
| ], | ||
| "extensions": [ | ||
| ".ml", | ||
| ".mli" | ||
| ], | ||
| "configuration": "./ocaml.configuration.json" | ||
| }, | ||
| { | ||
|
|
@@ -234,23 +162,40 @@ | |
| }, | ||
| { | ||
| "id": "ocaml.merlin", | ||
| "aliases": ["Merlin"], | ||
| "extensions": ["merlin"] | ||
| "aliases": [ | ||
| "Merlin" | ||
| ], | ||
| "extensions": [ | ||
| "merlin" | ||
| ] | ||
| }, | ||
| { | ||
| "id": "ocaml.ocamlbuild", | ||
| "aliases": ["OCamlbuild"], | ||
| "extensions": ["_tags"] | ||
| "aliases": [ | ||
| "OCamlbuild" | ||
| ], | ||
| "extensions": [ | ||
| "_tags" | ||
| ] | ||
| }, | ||
| { | ||
| "id": "ocaml.opam", | ||
| "aliases": ["OPAM"], | ||
| "extensions": ["opam"] | ||
| "aliases": [ | ||
| "OPAM" | ||
| ], | ||
| "extensions": [ | ||
| "opam" | ||
| ] | ||
| }, | ||
| { | ||
| "id": "reason", | ||
| "aliases": ["Reason"], | ||
| "extensions": [".re", ".rei"], | ||
| "aliases": [ | ||
| "Reason" | ||
| ], | ||
| "extensions": [ | ||
| ".re", | ||
| ".rei" | ||
| ], | ||
| "configuration": "./reason.configuration.json" | ||
| }, | ||
| { | ||
|
|
@@ -263,15 +208,6 @@ | |
| "id": "reason.hover.type" | ||
| } | ||
| ], | ||
| "menus": { | ||
| "editor/context": [ | ||
| { | ||
| "command": "reason.caseSplit", | ||
| "group": "reason", | ||
| "when": "editorTextFocus && resourceLangId == reason" | ||
| } | ||
| ] | ||
| }, | ||
| "snippets": [ | ||
| { | ||
| "language": "reason", | ||
|
|
@@ -281,20 +217,20 @@ | |
| "problemMatchers": [ | ||
| { | ||
| "name": "ocamlc", | ||
|
|
||
| "fileLocation": ["relative", "${workspaceFolder}"], | ||
| "fileLocation": [ | ||
| "relative", | ||
| "${workspaceFolder}" | ||
| ], | ||
| "pattern": [ | ||
| { | ||
| "regexp": | ||
| "^\\s*\\bFile\\b\\s*\"(.*)\",\\s*\\bline\\b\\s*(\\d+),\\s*\\bcharacters\\b\\s*(\\d+)-(\\d+)\\s*:\\s*$", | ||
| "regexp": "^\\s*\\bFile\\b\\s*\"(.*)\",\\s*\\bline\\b\\s*(\\d+),\\s*\\bcharacters\\b\\s*(\\d+)-(\\d+)\\s*:\\s*$", | ||
| "file": 1, | ||
| "line": 2, | ||
| "column": 3, | ||
| "endColumn": 4 | ||
| }, | ||
| { | ||
| "regexp": | ||
| "^(?:\\s*\\bParse\\b\\s*)?\\s*\\b([Ee]rror|Warning)\\b\\s*(?:\\(\\s*\\bwarning\\b\\s*(\\d+)\\))?\\s*:\\s*(.*)$", | ||
| "regexp": "^(?:\\s*\\bParse\\b\\s*)?\\s*\\b([Ee]rror|Warning)\\b\\s*(?:\\(\\s*\\bwarning\\b\\s*(\\d+)\\))?\\s*:\\s*(.*)$", | ||
| "severity": 1, | ||
| "code": 2, | ||
| "message": 3 | ||
|
|
@@ -315,15 +251,16 @@ | |
| "@types/lodash.flatmap": "^4.5.3", | ||
| "@types/node": "9.6.2", | ||
| "@types/pegjs": "0.10.0", | ||
| "@types/uuid": "^3.4.4", | ||
| "prettier": "1.11.1", | ||
| "tslint": "5.9.1", | ||
| "typescript": "2.8.1", | ||
| "vscode": "1.1.14" | ||
| }, | ||
| "dependencies": { | ||
| "lodash.flatmap": "^4.5.0", | ||
| "ocaml-language-server": "1.0.35", | ||
| "pegjs": "0.10.0", | ||
| "uuid": "^3.3.2", | ||
| "vscode-jsonrpc": "3.6.0", | ||
| "vscode-languageclient": "4.0.1", | ||
| "vscode-languageserver": "4.0.0", | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rusty-key @andreypopp One of the main advantages of this bsb integration was that bsb has full project visibility. So if one file changes and that change breaks other files, bsb is able to show those errors in the Diagnostics panel, even if the file is not opened. One has just to click on them to open the broken file, which is useful for large refactors.
Is something like that possible with merlin? I always believed that merlin only has a "local view" of the world. 🤔