Skip to content

Commit ecf77ad

Browse files
authored
Remove ocaml.ocamllex from type-dependent command conditions (#1984)
* Remove `ocaml.ocamllex` from type-dependent command conditions OCamllex files (.mll) use a specialised lexer definition syntax and do not have full LSP support with type information. Commands that require type information should not be available for these files. Remove `ocaml.ocamllex` from the when conditions of the following type-dependent commands in both `keybindings` and `commandPalette`: - `ocaml.construct` - `ocaml.next-hole` - `ocaml.prev-hole` - `ocaml.search-by-type` - `ocaml.copy-type-under-cursor` Signed-off-by: Sora Morimoto <[email protected]> * Update CHANGELOG.md Signed-off-by: Sora Morimoto <[email protected]> --------- Signed-off-by: Sora Morimoto <[email protected]>
1 parent 292bf82 commit ecf77ad

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
- Fix editor focus condition for interface file keybindings. Previously,
66
keybindings for `ocaml.interface` files were active even when the editor
77
did not have focus due to operator precedence in the when clauses. (#1983)
8+
- Remove `ocaml.ocamllex` from type-dependent command conditions. OCamllex
9+
files use a specialised lexer definition syntax and do not have full LSP
10+
support with type information. Commands requiring type information
11+
(`construct`, `next-hole`, `prev-hole`, `search-by-type`,
12+
`copy-type-under-cursor`) were incorrectly enabled for `.mll` files and
13+
have been removed. (#1984)
814

915
## 1.32.3
1016

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -827,12 +827,12 @@
827827
{
828828
"command": "ocaml.next-hole",
829829
"key": "Alt+Y",
830-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
830+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
831831
},
832832
{
833833
"command": "ocaml.prev-hole",
834834
"key": "Shift+Alt+Y",
835-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
835+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
836836
},
837837
{
838838
"command": "ocaml.reveal-ast-node",
@@ -847,7 +847,7 @@
847847
{
848848
"command": "ocaml.search-by-type",
849849
"key": "Alt+F",
850-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
850+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
851851
},
852852
{
853853
"command": "ocaml.type-selection",
@@ -1104,11 +1104,11 @@
11041104
},
11051105
{
11061106
"command": "ocaml.next-hole",
1107-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
1107+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
11081108
},
11091109
{
11101110
"command": "ocaml.prev-hole",
1111-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
1111+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
11121112
},
11131113
{
11141114
"command": "ocaml.refresh-switches",
@@ -1160,15 +1160,15 @@
11601160
},
11611161
{
11621162
"command": "ocaml.copy-type-under-cursor",
1163-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
1163+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
11641164
},
11651165
{
11661166
"command": "ocaml.construct",
1167-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
1167+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
11681168
},
11691169
{
11701170
"command": "ocaml.search-by-type",
1171-
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason || editorLangId == ocaml.ocamllex"
1171+
"when": "editorLangId == ocaml || editorLangId == ocaml.interface || editorLangId == reason"
11721172
},
11731173
{
11741174
"command": "ocaml.navigate-typed-holes",

0 commit comments

Comments
 (0)