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

Adopt new auto commit characters for completion items #1487

Closed
jrieken opened this issue May 17, 2017 · 2 comments
Closed

Adopt new auto commit characters for completion items #1487

jrieken opened this issue May 17, 2017 · 2 comments

Comments

@jrieken
Copy link
Contributor

jrieken commented May 17, 2017

Omnisharp-vscode can accept suggestions while also insert certain characters, like Cons will insert Console and insert a . when the dot-character is pressed. This has been "implemented" via keybindings. Mea culpa

The keybindings "implementation" has its weakness and in the meantime VS Code as an API for commit characters. In short, when creating a completion item you can assign it a set of commit characters:

item1 = new CompletionItem('Console')
item1.commitCharacters = ['.']; // no '(' because Console cannot be called

item2 = new CompletionItem('SomeMethod')
item2.commitCharacters = ['('] // can be called

// etc
@jrieken jrieken changed the title Adopt new auto characters Adopt new auto commit characters for completion items May 17, 2017
@DustinCampbell
Copy link
Member

@jrieken: Nice! Does the API tell us what character actually caused the completion item to commit? In VS, there are cases where completion can commit differently depending on what character is pressed.

@jrieken
Copy link
Contributor Author

jrieken commented May 18, 2017

No, once we have what we want we don't talk back to the provider...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants