Skip to content

Replace spaces in socketname with '_'#1345

Merged
voodoos merged 3 commits intoocaml:masterfrom
ttamttam:replace_spaces_in_windows_pipe
Jul 23, 2021
Merged

Replace spaces in socketname with '_'#1345
voodoos merged 3 commits intoocaml:masterfrom
ttamttam:replace_spaces_in_windows_pipe

Conversation

@ttamttam
Copy link
Copy Markdown
Contributor

@ttamttam ttamttam commented Jun 5, 2021

On windows, if the username retrieved by GetUserName contain spaces, they end up in the socketname, and emacs fails when trying to open it.

@voodoos voodoos requested a review from let-def June 7, 2021 09:06
@let-def
Copy link
Copy Markdown
Contributor

let-def commented Jun 7, 2021

The patch look good thanks. I am surprised by the emacs bit: the socketname should not leak to the editor, right?

@ttamttam
Copy link
Copy Markdown
Contributor Author

ttamttam commented Jun 7, 2021

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:

#599 (comment)

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

@let-def
Copy link
Copy Markdown
Contributor

let-def commented Jun 7, 2021

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).
So the problem has to do with some Windows IPC that I does not understand, but I am glad the _ fixes it, thanks!

@let-def
Copy link
Copy Markdown
Contributor

let-def commented Jun 7, 2021

(Maybe @dra27 can tell us more about that?)

@ttamttam
Copy link
Copy Markdown
Contributor Author

replacing the USER by it’s SID.

Instead of removing spaces, I tried to follow @dra27 original plan (see #599 (comment)).

@ttamttam ttamttam requested a review from let-def June 20, 2021 12:54
Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

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

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!

@ttamttam
Copy link
Copy Markdown
Contributor Author

Thanks @dra27 . I’ll have a look. Despite how painful is C for me, nowadays!

@voodoos voodoos added this to the Release 4.3 / 3.6 milestone Jul 13, 2021
@voodoos voodoos requested review from let-def and removed request for let-def July 13, 2021 15:25
Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

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

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 NULL after free makes the flow harder to follow (for me), especially when there's a clear return statement 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 than return usidstr; where usidstr was set to NULL many 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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personally, I would explicitly NULL here, rather than subtly via a variable

Suggested change
return usidstr;
return NULL;

if ( ! OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &process_token ) )
return usidstr;

unsigned long sid_buffer_size = 0;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
unsigned long sid_buffer_size = 0;
DWORD sid_buffer_size;

Comment on lines +540 to +541
process_token = NULL;
return usidstr;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
process_token = NULL;
return usidstr;
return NULL;

(this isn't C++ - the assignment of NULL should be eliminated by the optimiser anyway 🙂)

Comment on lines +548 to +549
process_token = NULL;
return usidstr;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
process_token = NULL;
return usidstr;
return NULL;

(as before)

Comment on lines +562 to +563
ConvertSidToStringSid(token_user_ptr->User.Sid, &usidstr);

free(token_user_ptr);
token_user_ptr = NULL;
CloseHandle(process_token);
process_token = NULL;

return usidstr;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
char * usidstr = NULL;
LPSTR usidstr;

#ifdef _WIN32

/* May return NULL */
char * retrieve_user_sid_string()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
char * retrieve_user_sid_string()
LPSTR retrieve_user_sid_string()

"\\\\.\\pipe\\%s", eventname);

LocalFree(user_sid_string);
user_sid_string = NULL;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
user_sid_string = NULL;

Comment on lines +584 to +582
char * user_sid_string = retrieve_user_sid_string();

if (! user_sid_string)
{
user_sid_string = LocalAlloc(LPTR, 1);
user_sid_string[0] = '\0';
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

Suggested change
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);

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Jul 21, 2021

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

@ttamttam
Copy link
Copy Markdown
Contributor Author

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

👍

@ttamttam
Copy link
Copy Markdown
Contributor Author

@dra27 @voodoos
Thanks for the detailed review.
It seems the CI workflows were triggered, but need to be approved.

ttamttam added 2 commits July 23, 2021 10:47
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
@voodoos voodoos force-pushed the replace_spaces_in_windows_pipe branch from c1fc61f to 63e05cb Compare July 23, 2021 08:50
@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Jul 23, 2021

Thank you for your contribution @ttamttam !

@voodoos voodoos merged commit aa0e207 into ocaml:master Jul 23, 2021
voodoos added a commit to voodoos/merlin that referenced this pull request Jul 23, 2021
…_pipe

Replace user names by their SIDs in socketnames on Windows
voodoos added a commit that referenced this pull request Jul 23, 2021
Replace user names by their SIDs in socketnames on Windows
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jul 26, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants