Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete not behaving properly for semi-colons (;) #1890

Closed
vezaynk opened this issue Apr 3, 2018 · 8 comments
Closed

Autocomplete not behaving properly for semi-colons (;) #1890

vezaynk opened this issue Apr 3, 2018 · 8 comments

Comments

@vezaynk
Copy link

vezaynk commented Apr 3, 2018

If I put a string inside a .re file such as

"any string";

An autocomplete appears for semi-colons suggesting the snippet above. It is very annoying and the autocomplete selects it and inserts it by pressing which a common thing to do after placing a semi-colon.

The issue is not present in any other languages which leads me to assume it is a problem not with VSCode but with the Reason IDE toolchain or some other component of the Reason toolchain.

Gif inserted below to demonstrate the issue.

vscode_reason_bug

@jordwalke
Copy link
Member

@freebroccolo Do you think this is related to ocaml-language-server? I don't see anything like this in vim without LSP.

@ghost
Copy link

ghost commented Apr 3, 2018

I'm not sure if it's due to the server or maybe due to the extension and how the word classification is handled (in conjunction with whatever the user editor suggest settings are). I haven't been using the extension/server with Reason much lately but I haven't seen this with OCaml.

Does it happen with Atom (using the language server)?

@knyzorg In vscode, when you go to the user settings panel (cmd+, on macOS), can you do a search for "editorsuggest" (one word, no spaces) and tell me the values of the settings that show up there?

@vezaynk
Copy link
Author

vezaynk commented Apr 4, 2018

I have no user-settings that override the defaults with the exception of these:

  "[json]":  {
    "editor.quickSuggestions": {
        "strings": true
    }
  },

  // Configure editor settings to be overridden for [makefile] language.
  "[makefile]":  {
    "editor.insertSpaces": false
  },

  // Configure editor settings to be overridden for [markdown] language.
  "[markdown]":  {
    "editor.wordWrap": "on",
    "editor.quickSuggestions": false
  },

For atom, I tried triggering the issue but was not able to. It seems to be back to a VSCode issue.

@vezaynk
Copy link
Author

vezaynk commented Apr 4, 2018

Another thing, if I trigger the autocomplete on nothing, I get it as first suggestion:

image

I'm suspecting that the bug I describe above is the consequence of this one.

I have no idea how it all works under the hood, I'm just trying to learn the language for now. Could it be that an ; is leading it to assume that the statement is finished and can now suggest it's own stuff without realizing it is still affecting the semi-colon? In essence, if the 'trigger' for the open autocomplete is currently the end of statement as identified by a ;, it should be instead identified as a ; followed by whitespace.

Just thinking out loud.

@ghost
Copy link

ghost commented Apr 4, 2018

First of all, the reason these suggestions are showing up is due to the "quick suggestions" feature of vscode. I have this disabled globally for all modes because I find it way too noisy and the suggestions often not relevant:

  "editor.quickSuggestions": {
    "other": false,
    "comments": false,
    "strings": false
  },

When you have this set, the vscode extension will only automatically trigger completions on things like . (module or record fields) and # (object methods). These completions come from the server.

The "quick suggestion" completions are (as far as I understand) calculated in an approximate way from the contents of the editor buffers. Personally, I would suggest disabling it. I think these strings might be included in the "quick suggestions" because I am using a more relaxed word-pattern than usual. This is for compatibility with another one of my extension vscode-input-assist.

I can try experimenting with that pattern to see if it's possible to exclude some cases like the one you show above. I imagine there are probably other ones though and I'd prefer to retain compatibility with vscode-input-assist.

@kevinbarabash
Copy link

I just started experimenting with Reason using VSCode and the the first string I typed "hello"; followed by a semi-colon is what shows up for me at the top of the list. Now whenever I type ; followed by ENTER it inserts "hello";. I had to disable "insert on enter". I use VSCode for other languages and haven't had this issue.

@ghost
Copy link

ghost commented Apr 17, 2018

If someone wants to try changing the word pattern for the extension and seeing if it has an effect on this, you can modify it here.

@jaredly
Copy link
Contributor

jaredly commented Jun 14, 2018

This issue really belongs on the vscode-reasonml repo -- it doesn't have to do with the code in this repo.

@jaredly jaredly closed this as completed Jun 14, 2018
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

No branches or pull requests

4 participants