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

Snippets are being displayed in auto-complete while inside of a comment #5069

Closed
prashantv opened this issue Apr 7, 2016 · 2 comments
Closed
Assignees

Comments

@prashantv
Copy link

  • VSCode Version: 0.10.14-insider (0.10.14-insider)
  • OS Version: OSX 10.11.4

Steps to Reproduce:

  1. Start a comment (e.g. in a .go file, start //
  2. Write some text, and then start entering the beginning of a snippet (e.g. main, or for)
  3. Press enter (expecting line break after the word main or for)

The snippet is inserted inside of the comment.

Snippets should be disabled inside of a comment.

Attached screencast in zip:
vscode-comment-snippet.zip

@jrieken jrieken assigned aeschli and unassigned jrieken Apr 7, 2016
@aeschli
Copy link
Contributor

aeschli commented Apr 7, 2016

Some people might want to write snippets for comment content. We don't want to prevent that.
Closing.

@aeschli aeschli closed this as completed Apr 7, 2016
@prashantv
Copy link
Author

The issue in this case is that the Go plugin defines these snippets, and knows that they are never useful for comments. If they can't be disabled completely, can the plugin specify whether the snippet should be excluded in some contexts like in a comment?

There's similar issues when writing:
"package main" - the "main" autocomplete is shown and ends up changing the code to

package func main() {
}

Or when writing func main and typing enter, it becomes

func func main() {
}

Both of which are very annoying (e.g. see microsoft/vscode-go#225).

It seems like snippets should be able to (optionally) specify a context for where they should be shown.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants