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

expose trigger character to signature help and completion provider #752

Closed
jrieken opened this issue Nov 27, 2015 · 11 comments
Closed

expose trigger character to signature help and completion provider #752

jrieken opened this issue Nov 27, 2015 · 11 comments
Assignees
Labels
api feature-request Request for new features or functionality on-testplan release-notes Release notes issues suggest IntelliSense, Auto Complete

Comments

@jrieken
Copy link
Member

jrieken commented Nov 27, 2015

Add a CompletionContext and SignatureHelpContext which contains the character that has triggered that request: { ch: string }

@jrieken jrieken added feature-request Request for new features or functionality api labels Nov 27, 2015
@jrieken jrieken self-assigned this Nov 27, 2015
@jrieken
Copy link
Member Author

jrieken commented Nov 27, 2015

Must not break the API - probe on arguments length

@jrieken jrieken added this to the Dec 2015 milestone Nov 27, 2015
@jrieken
Copy link
Member Author

jrieken commented Dec 4, 2015

Challenge is to have a nice signature that is backwards compatible. I only see something like this

interface CompletionItemProvider {
  providerItem: ((doc, pos, token) => CompletionItem[] | Promise<CompletionItem[]>) | ((doc, pos, context, token) => CompletionItem[] | Promise<CompletionItem[]>)
}

which I am not a big fan of

@jrieken jrieken removed this from the Dec 2015 milestone Dec 4, 2015
@jrieken
Copy link
Member Author

jrieken commented Dec 4, 2015

Needs more thinking...

@jrieken
Copy link
Member Author

jrieken commented Dec 9, 2015

Also, expose if it got triggered because of 24x7 intellisense or manually.

@joaomoreno
Copy link
Member

Do it and 🍺

@jrieken
Copy link
Member Author

jrieken commented Jan 25, 2016

parts of this are addressed by #2224

@jrieken jrieken added this to the September 2017 milestone Sep 8, 2017
@jrieken
Copy link
Member Author

jrieken commented Sep 8, 2017

Should be another overload of provideCompletionItems, like so

interface CompletionContext {
  triggerCharacter: string;
  // manual? auto? isRefining...
}

provideCompletionItems(document: TextDocument, position: Position, context: CompletionContext, token: CancellationToken): ProviderResult<CompletionItem[] | CompletionList>;

The challenge is that there are already many completion item providers expecting 3 arguments and that we need to check on that before calling, Function.length is our friend

@jrieken jrieken added the suggest IntelliSense, Auto Complete label Sep 8, 2017
@jrieken jrieken reopened this Sep 21, 2017
@jrieken
Copy link
Member Author

jrieken commented Sep 21, 2017

We have now context information for completion request. Most people should be happy now. I am creating a new issue for context information when making signature help requests

@DustinCampbell
Copy link
Member

awesome!

@jrieken
Copy link
Member Author

jrieken commented Sep 21, 2017

@DustinCampbell Let me know if you are missing something. We have started small, just exposing the trigger character and deciding between two kinds: manual and trigger character

@DustinCampbell
Copy link
Member

I'll let you know. However, this should make it possible for C# to offer completion in special cases after SPACE. For example:

List<int> l = new // <-- We trigger a completion list on SPACE here that contains List<int>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality on-testplan release-notes Release notes issues suggest IntelliSense, Auto Complete
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants