Replace spaces in socketname with '_'#1345
Conversation
|
The patch look good thanks. I am surprised by the emacs bit: the socketname should not leak to the editor, right? |
A more detailed explanation of how I found this solution is here: Roughly (I did not check), I would think that at some time, ocamlmerlin has to say to the editor which socket it should connect to? I can no more test it, because I renamed my windows account since then (which was not easy…). Best regards |
|
Indeed, now I remember. Thanks for the PR. The socketpath does not leak in normal emacs mode, it is only provided in the debug info. Emacs does not connect directly to the socket, the merlin wrapper handles both side (starting a server if there is none, connecting to it if there is one). |
|
(Maybe @dra27 can tell us more about that?) |
|
replacing the USER by it’s SID. Instead of removing spaces, I tried to follow @dra27 original plan (see #599 (comment)). |
dra27
left a comment
There was a problem hiding this comment.
Some comments on the implementation as given, but I think it's better to avoid LookupAccountName and do GetCurrentProcessId -> OpenProcessToken -> GetTokenInformation with the TokenUser class which yields a TOKEN_USER struct containing the SID which finally goes on to the code you already have for ConvertSidToStringSid!
|
Thanks @dra27 . I’ll have a look. Despite how painful is C for me, nowadays! |
dra27
left a comment
There was a problem hiding this comment.
The only important change is the (un-)capitalisation of Sddl.h - this looks correct to me, thanks!
The rest is C "style" points, which are very much "take or leave":
- Assignments of
NULLafterfreemakes the flow harder to follow (for me), especially when there's a clearreturnstatement following (i.e. there's visibly no chance of use-after-free) - I'd definitely use Windows API types
- Personally, I think
return NULL;is a much clearer statement of intent thanreturn usidstr;whereusidstrwas set toNULLmany control blocks and lines earlier.
I haven't actually compiled this - happy to be pinged to do that as and when it's confirmed ready to merge!
| { | ||
| char * usidstr = NULL; | ||
|
|
||
| void * process_token = NULL; |
There was a problem hiding this comment.
| void * process_token = NULL; | |
| HANDLE process_token; |
(don't second-guess Windows API types)
|
|
||
| void * process_token = NULL; | ||
| if ( ! OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &process_token ) ) | ||
| return usidstr; |
There was a problem hiding this comment.
Personally, I would explicitly NULL here, rather than subtly via a variable
| return usidstr; | |
| return NULL; |
| if ( ! OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &process_token ) ) | ||
| return usidstr; | ||
|
|
||
| unsigned long sid_buffer_size = 0; |
There was a problem hiding this comment.
| unsigned long sid_buffer_size = 0; | |
| DWORD sid_buffer_size; |
| process_token = NULL; | ||
| return usidstr; |
There was a problem hiding this comment.
| process_token = NULL; | |
| return usidstr; | |
| return NULL; |
(this isn't C++ - the assignment of NULL should be eliminated by the optimiser anyway 🙂)
| process_token = NULL; | ||
| return usidstr; |
There was a problem hiding this comment.
| process_token = NULL; | |
| return usidstr; | |
| return NULL; |
(as before)
| ConvertSidToStringSid(token_user_ptr->User.Sid, &usidstr); | ||
|
|
||
| free(token_user_ptr); | ||
| token_user_ptr = NULL; | ||
| CloseHandle(process_token); | ||
| process_token = NULL; | ||
|
|
||
| return usidstr; |
There was a problem hiding this comment.
| ConvertSidToStringSid(token_user_ptr->User.Sid, &usidstr); | |
| free(token_user_ptr); | |
| token_user_ptr = NULL; | |
| CloseHandle(process_token); | |
| process_token = NULL; | |
| return usidstr; | |
| if (!ConvertSidToStringSid(token_user_ptr->User.Sid, &usidstr) | |
| usidstr = NULL; | |
| free(token_user_ptr); | |
| CloseHandle(process_token); | |
| return usidstr; |
| /* May return NULL */ | ||
| char * retrieve_user_sid_string() | ||
| { | ||
| char * usidstr = NULL; |
There was a problem hiding this comment.
| char * usidstr = NULL; | |
| LPSTR usidstr; |
| #ifdef _WIN32 | ||
|
|
||
| /* May return NULL */ | ||
| char * retrieve_user_sid_string() |
There was a problem hiding this comment.
| char * retrieve_user_sid_string() | |
| LPSTR retrieve_user_sid_string() |
| "\\\\.\\pipe\\%s", eventname); | ||
|
|
||
| LocalFree(user_sid_string); | ||
| user_sid_string = NULL; |
There was a problem hiding this comment.
| user_sid_string = NULL; |
| char * user_sid_string = retrieve_user_sid_string(); | ||
|
|
||
| if (! user_sid_string) | ||
| { | ||
| user_sid_string = LocalAlloc(LPTR, 1); | ||
| user_sid_string[0] = '\0'; | ||
| } | ||
|
|
There was a problem hiding this comment.
Note that LPTR explicitly zeros the memory, so there's no need to assign \0 afterwards.
I don't know how much it matters these days, but there are still supported versions of MSVC which require C90 variables at the start of blocks. I'd put LPSTR user_sid_string below #ifdef _WIN32 above and then:
| char * user_sid_string = retrieve_user_sid_string(); | |
| if (! user_sid_string) | |
| { | |
| user_sid_string = LocalAlloc(LPTR, 1); | |
| user_sid_string[0] = '\0'; | |
| } | |
| /* user_sid_string is either the sid, or `""` and needs `LocalFree`ing */ | |
| user_sid_string = retrieve_user_sid_string() || LocalAlloc(LPTR, 1); |
|
@ttamttam : I just enabled Windows CI on master. It should run once you rebase your PR. The CI builds the binaries and run a subset of the test suite. |
👍 |
On windows, if the username retrieved by `GetUserName` contain spaces, they end up in the socketname, and emacs fails when trying to open it.
- Created a retrieve_user_sid_string function. - compiles on my windows VM - checked that 'eventname' contains an user SID
c1fc61f to
63e05cb
Compare
|
Thank you for your contribution @ttamttam ! |
…_pipe Replace user names by their SIDs in socketnames on Windows
Replace user names by their SIDs in socketnames on Windows
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested,
`<c-i>` and `<c-u>`
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested,
`<c-i>` and `<c-u>`
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested,
`<c-i>` and `<c-u>`
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested,
`<c-i>` and `<c-u>`
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested,
`<c-i>` and `<c-u>`
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested,
`<c-i>` and `<c-u>`
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
CHANGES:
Mon Jul 26 11:13:37 AM CET 2021
+ merlin binary
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
to show more or less deep results. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
CHANGES:
Mon Jul 26 04:45:37 PM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested, `<c-i>`
and `<c-u>` can be use to change the depth of the recursive
construction. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
- disable tests failing in Opam's CI due to nested dune projects (ocaml/merlin#1373)
CHANGES:
Mon Jul 26 04:45:37 PM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested, `<c-i>`
and `<c-u>` can be use to change the depth of the recursive
construction. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
- disable tests failing in Opam's CI due to nested dune projects (ocaml/merlin#1373)
CHANGES:
Mon Jul 26 04:43:37 PM CET 2021
+ merlin binary
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
+ test suite
- disable tests failing in Opam's CI due to nested dune projects
CHANGES:
Mon Jul 26 04:45:37 PM CET 2021
+ merlin binary
- recover ill-typed patterns (ocaml/merlin#1317, ocaml/merlin#1342)
- more accurate type-enclosing for methods (ocaml/merlin#1328, fixes ocaml/merlin#1124)
- fix location of patterns in Occurrences (ocaml/merlin#1324, fixes ocaml/ocaml-lsp#375)
- fix location of module definitions done via functors (ocaml/merlin#1329, fixes ocaml/merlin#1199)
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- add new module holes that can replace module expressions (ocaml/merlin#1333)
- add a new command `construct` that builds a list of possible terms when
called on a typed hole (ocaml/merlin#1318)
- `refactor-open` improvements (ocaml/merlin#1313, ocaml/merlin#1314, ocaml/merlin#1366, ocaml/merlin#1372)
- do not make paths absolute, simply prefix with the identifier under
the cursor
```ocaml
open Foo (* calling refactor-open qualify on this open *)
let _ = Foo.bar (* previously could result in [Dune__exe.Foo.bar] *)
```
- do not return identical (duplicate) edits
- do not return unnecessary edits that when applied do not change
the document
- handle record fields properly
- handle multi-line paths
- `unqualify` should not qualify
- Handle `Persistent_env.Error` in `Typemod.initial_env` (ocaml/merlin#1355)
- locate: reset global state from all entry points (ocaml/merlin#1364)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add a simple interface to the new `construct` command:
`MerlinConstruct`. When several results are suggested, `<c-i>`
and `<c-u>` can be use to change the depth of the recursive
construction. (ocaml/merlin#1318)
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add a simple interface to the new `construct` command:
`merlin-construct`. (ocaml/merlin#1352)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
- emacs: fix issue with `merlin--highlight` and various minor improvements
(ocaml/merlin#1367, @mattiase)
+ test suite
- cover the new `construct` command (ocaml/merlin#1318)
- disable tests failing in Opam's CI due to nested dune projects (ocaml/merlin#1373)
CHANGES:
Mon Jul 26 04:43:37 PM CET 2021
+ merlin binary
- fix -cmt-path dirs mistakenly added to build path (ocaml/merlin#1330)
- Windows: replace user name by its SID in socketnames (ocaml/merlin#1345, @ttamttam)
+ editor modes
- vim: add support for the `merlin-locate-type` command:
`MerlinLocateType` (ocaml/merlin#1359)
- emacs: add support for the `merlin-locate-type` command. (ocaml/merlin#1359)
+ test suite
- disable tests failing in Opam's CI due to nested dune projects
On windows, if the username retrieved by
GetUserNamecontain spaces, they end up in the socketname, and emacs fails when trying to open it.