Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4637b8a
WIP: support for ocamlmerlin-lsp
andreypopp Jan 31, 2019
1072823
use merlin-lsp for all projects
Feb 24, 2019
aec1eac
remove ols-related code
Feb 28, 2019
a4c1821
add formatters
Feb 28, 2019
d52fee6
use temp files to better handle large files
Feb 28, 2019
57590da
fix formatting
Feb 28, 2019
690f2a4
revert unrelated change
Mar 10, 2019
c705687
tweak options format
Mar 10, 2019
32fe6d3
handle possible errors
Mar 10, 2019
798219e
remove debug
Mar 10, 2019
8bd13e5
remove unsupported settings
Mar 10, 2019
7000de8
prebuild merlin-lsp/merlin-reason and use them for reason projects
Mar 29, 2019
8f44e4e
use platform’s tmp dir
Mar 29, 2019
ce09262
fix lsp binaries
Mar 30, 2019
c6d6408
remove ocamlfind dependency
Mar 30, 2019
bf91e25
get rid of custom paths
Apr 5, 2019
280112c
add some checks
Apr 5, 2019
8e11395
use esy for formatters
Apr 5, 2019
9ae3159
fix code style
Apr 5, 2019
be95b57
add local opam switch support
Khady Apr 8, 2019
9e7085d
Merge pull request #1 from Khady/opam-switch-support
Apr 8, 2019
b06b7ec
add restart ls command
Apr 8, 2019
9c7682d
fix refmt’s temp file extension
Apr 8, 2019
6a75a9a
remove debug
Apr 8, 2019
7e1dc9d
add esy.json generation for bs projects
Apr 11, 2019
a6c0889
add resolutions for 4.02
Apr 11, 2019
d5845d8
ignore packaged extensions
Apr 22, 2019
6c78709
init merlin-lsp when it is installed
Apr 22, 2019
c95bbc2
"simplify" extension setup
Jul 20, 2019
c7c77e4
pass ocamlmerlin-reason path
Jul 21, 2019
520bdd4
describe 4.02 setup
Jul 21, 2019
2b66c0e
update readme
Jul 21, 2019
be6cac2
remove unused utils
Jul 21, 2019
c759a28
fix version
Jul 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added executables/darwin/ocamlmerlin-lsp
Binary file not shown.
Binary file added executables/darwin/ocamlmerlin-reason
Binary file not shown.
Binary file added executables/linux/ocamlmerlin-lsp
Binary file not shown.
Binary file added executables/linux/ocamlmerlin-reason
Binary file not shown.
209 changes: 73 additions & 136 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Copy link
Member

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. 🤔

},
"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": {
Copy link
Member

Choose a reason for hiding this comment

The 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": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rusty-key I think this can be removed too, it was used for the env introspection (like ocamlfind, env etc)

"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."
}
}
},
Expand Down Expand Up @@ -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"
}
Expand All @@ -222,8 +145,13 @@
"languages": [
{
"id": "ocaml",
"aliases": ["OCaml"],
"extensions": [".ml", ".mli"],
"aliases": [
"OCaml"
],
"extensions": [
".ml",
".mli"
],
"configuration": "./ocaml.configuration.json"
},
{
Expand All @@ -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"
},
{
Expand All @@ -263,15 +208,6 @@
"id": "reason.hover.type"
}
],
"menus": {
"editor/context": [
{
"command": "reason.caseSplit",
"group": "reason",
"when": "editorTextFocus && resourceLangId == reason"
}
]
},
"snippets": [
{
"language": "reason",
Expand All @@ -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
Expand All @@ -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",
Expand Down
17 changes: 0 additions & 17 deletions src/client/command/doShowAvailableLibraries.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/client/command/doShowMerlinFiles.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/client/command/doShowProjectEnv.ts

This file was deleted.

Loading