Skip to content

Don't try to content assist in comments #1657

Closed

Description

@pspi

Don't try to content assist / perform intellisense when writing a comment. Really really annoying, when every other word pops up suggestions. Don't want it.

Dupe of #538 that got closed but not fixed really though.

Activity

  1. added
    bug
    on Dec 28, 2015
  2. felixfbecker commented on Dec 28, 2015

    @felixfbecker
    Contributor

    Imo word suggestions are often quite helpful. For example when I make a comment like "this is later called by ..." and VS Code automatically suggests the long method name as I type.

  3. Kroc commented on Dec 29, 2015

    @Kroc

    @fleixfbecker yes, but 'code' within comments should be escaped with backticks, the intellisense whilst writing comments is really slowing down my typing and interfering with expected spc/tab when writing prose.

  4. bpasero commented on Jan 13, 2016

    @bpasero
    Contributor

    I am hitting an issue in comments that is ugly. My intent is to write this inside a TS/JS file:

    /**
     * this is set.
     */
    

    However set is a snippet and typing "." completes it so I end up with:

    /**
     * this is 
     public set .(v : string) {
         this. = v;
     }
    
     */
    

    Typing undo here I end up with:

    /** */
    

    alexandrudima fyi about the undo behaviour here which is not very helpful.

  5. jrieken commented on Jan 13, 2016

    @jrieken
    Contributor

    We should not add snippets inside comments, tho I am unsure if we know that when inserting them.

  6. alexdima commented on Jan 13, 2016

    @alexdima
    Member

    Benjamin Pasero (@bpasero) Pushed fix for undo behavior in 2cdf977

  7. bpasero commented on Jan 13, 2016

    @bpasero
    Contributor

    alexandrudima nice thanks!

  8. Kroc commented on Jan 13, 2016

    @Kroc

    A set of 'scopes' / 'escapes' could be provided for comments, primarily that triple slash enables a 'line of code' within a comment, where intellisense could be available.

  9. jrieken commented on Jan 13, 2016

    @jrieken
    Contributor

    yeah, #580 is about scopes et al - we don't have it yet in the ext host

  10. alexdima commented on Jan 14, 2016

    @alexdima
    Member

    Johannes Rieken (@jrieken) Should we try to make the IntelliSense request pass in the scopes besides the position?

  11. jrieken commented on Jan 14, 2016

    @jrieken
    Contributor

    That makes it related to #1172 which is about adding more contextual information to the provider. Two other options that I favour is either something like TextDocument.scopesAtPosition/Offset or the extend the document selector to know about scopes { language: 'javascript', scopes: 'comment.doc' }. The latter might be easiest to implement since it's evaluated on the main side

  12. andy-hanson commented on Jan 18, 2016

    @andy-hanson

    It would also be nice to not have a leading * automatically added when I add a new line to a comment.

  13. jrieken commented on Jan 18, 2016

    @jrieken
    Contributor

    Andy Hanson (@andy-hanson) For jsdoc that should actually happen.

  14. 19 remaining items

  15. natefinch commented on May 23, 2016

    @natefinch

    FWIW, I also find this to be super annoying. I've never seen another editor suggest random words from the file when typing comments. It's distracting and unhelpful. I'm fine with having to set a value to turn it off, but please give me that ability... and I mean turning off suggestions in comments entirely.

    I'm not sure why this issue is marked as closed... unless I'm missing something, there's been no proposed workaround for the problem of showing suggestions, only for turning off autocomplete on enter, which is more of a symptom than the actual disease.

  16. alexturek commented on Nov 4, 2016

    @alexturek

    Searching for turn off suggestion in text files vscode I get to #3137 which is closed as a dupe of #2496 which is closed as a dupe of this issue which... doesn't help me disable suggestions in a specific file format.

    Has anyone actually solved this, or did that issue get conflated with the ability to completely disable intellisense? The docs suggest it's still not possible to disable by file format.

  17. jimfoye commented on Nov 18, 2016

    @jimfoye

    When I hit the enter key to start a new line in a comment, the editor often "helpfully" completes my sentence with something I don't want. I don't think I could put it any better than Nate Finch (@natefinch) did above. This is really annoying!

  18. jtzeng commented on Dec 1, 2016

    @jtzeng

    Ah that's a shame. Guess I just have to disable it manually. :(

  19. DarrenCook commented on Jan 26, 2017

    @DarrenCook

    Could someone, who knows the code, suggest where a patch would go, and how it might work?

    I guess we need a boolean function that will ask isCursorInsideAComment(), or getCursorContext() might be better, so we can distinguish between single-line comments, block comments, and javadoc comments (start with /**).

    And then use that function (*) at the point where it decides if to show intellisense suggestions or not. I think the answer to the latter might be related to #1172 ?
    *: based on a user setting, of course, so people who want to write code inside comments still can.

  20. JesperTreetop commented on Jan 31, 2017

    @JesperTreetop

    Per the other comments, please reopen this or allow one of the "dupe" issues to be opened for the benefit of those of us who don't want random word autocomplete when editing text files. Since editing Markdown files is one of the intended uses of Visual Studio Code to the extent that it gets special features like live preview, I think this deserves not to be clumped together with disabling autocomplete within comments (which is probably still a good idea).

  21. JesperTreetop commented on Jan 31, 2017

    @JesperTreetop

    For those that don't want to see word-based suggestion for certain languages you can say "[markdown]": { "editor.wordBasedSuggestions": false } (available in insiders today or the January release).

    This is spectacular, since it was something that wasn't possible yet earlier in the thread. Awaiting the January release with bated breath. 😄

  22. jrieken commented on Jan 31, 2017

    @jrieken
    Contributor

    re #1657 (comment): Sorry, I deleted my comment because it contained a link to the wrong issue 🙃

    So, this is what I have suggested in #10819 (comment):

    "editor.wordBasedCompletion": true,
    "[markdown]": {
      "editor.wordBasedCompletion": false
    }
  23. jrieken commented on Jan 31, 2017

    @jrieken
    Contributor

    I have also reopened this issue for the following change: In addition to the plain boolean that editor.wordBasedCompletion accepts today I want to extend it to something that allows to say word based suggestion 'in comment only', 'in string only', 'nowhere' etc. Samples:

    // nowhere
    "editor.wordBasedCompletion": false,
    
    // everywhere
    "editor.wordBasedCompletion": true,
    
    // somewhere
    "editor.wordBasedCompletion": {
      "inStrings": true,
      "inComment": false,
      "inCode": true
    }
  24. alexturek commented on Mar 2, 2017

    @alexturek

    Hey, thank you to whoever added file-type specific editor settings. Now.. can we get all file types, and not just the four that exist? I'd be happy to open a PR if someone could point me to the right area.

    I'm not sure why these were the only languages that made the cut :)

    EDIT: Spoke too soon!

    For anyone else who finds this issue:

    1. Go to language-specific settings (cmd + shift + P)

    screen shot 2017-03-02 at 8 17 47 am

    1. This will insert the correct language settings override in your settings.json, which you can then edit

    screen shot 2017-03-02 at 8 18 32 am

  25. jrieken commented on Mar 8, 2017

    @jrieken
    Contributor

    The additional configuration options for word-based suggestion are now tracked in #9504 and are plan for March. Closing this issue as the remaining work will happen there. Happy Coding!

  26. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions