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

whether i can get all completionitem list include vscode itself provided in plugin api "registerCompletionItemProvider"? #956

Closed
BleyChen opened this issue Dec 3, 2015 · 5 comments
Assignees

Comments

@BleyChen
Copy link

BleyChen commented Dec 3, 2015

whether vscode can change the mechanism that make me can get all all completionitem list include vscode itself provided in the following method provideCompletionItems in my vscode plugin? where I can know how vscode deal with this in vscode source?

vscode.languages.registerCompletionItemProvider("javascript",
{
    resolveCompletionItem(item:vscode.CompletionItem, token: vscode.CancellationToken): vscode.CompletionItem 
    {
    var completionItem1:vscode.CompletionItem = new vscode.CompletionItem("id");
    completionItem1.detail = "aaa";
    completionItem1.filterText = "aa";
    completionItem1.insertText = "aa";
    return completionItem1;
    }
    ,
    provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.CompletionItem[]> 
    {
        return new Promise((resolve, reject) => { 
        var completionItems:vscode.CompletionItem[] = [];

        return resolve(completionItems) ;
                    });
    }
})
@jrieken jrieken added the info-needed Issue requires more information from poster label Dec 3, 2015
@jrieken
Copy link
Member

jrieken commented Dec 3, 2015

@BleyChen Is this a bug or a feature request? Please provide more detail ala actual behaviour vs. expected behaviour

@BleyChen
Copy link
Author

BleyChen commented Dec 3, 2015

yes, recently i was reading the vscode source and i want to know whether i can change the vscode source that make me can get all the completionitem list include vscode itself provided in method "provideCompletionItems".

@BleyChen
Copy link
Author

BleyChen commented Dec 7, 2015

I have add the comment that what i want as following:
testaaa

@jrieken
Copy link
Member

jrieken commented Dec 7, 2015

Yes but with care only. With the Dec15 update you can invoke this command https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/api/common/extHostLanguageFeatureCommands.ts#L55 to retrieve the same list of completions the UI would show. Note, that it will recurse into your provideCompletionItems call so that you must guard yourself to not recurse endless.

@jrieken jrieken closed this as completed Dec 7, 2015
@jrieken
Copy link
Member

jrieken commented Dec 7, 2015

Duplicate of #913

@jrieken jrieken removed the info-needed Issue requires more information from poster label Dec 7, 2015
@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

2 participants