Skip to content

Commit 5b5aadf

Browse files
committed
fix the inlineCompletion example
Now that the extension is GA, the code sample does not need the proposed API the API has been simplified a bit since the proposal, so the code has been simplified as well
1 parent 6686321 commit 5b5aadf

File tree

3 files changed

+1
-85
lines changed

3 files changed

+1
-85
lines changed

inline-completions/package.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"enabledApiProposals": [
3-
"inlineCompletionsAdditions"
4-
],
52
"name": "inline-completion-sample",
63
"displayName": "Inline Completion Sample",
74
"description": "Sample showing how to implement an inline completion provider",
@@ -24,14 +21,7 @@
2421
"command": "extension.inline-completion-settings",
2522
"title": "My Inline Completion Demo Settings"
2623
}
27-
],
28-
"menus": {
29-
"editor/inlineCompletions/actions": [
30-
{
31-
"command": "extension.inline-completion-settings"
32-
}
33-
]
34-
}
24+
]
3525
},
3626
"scripts": {
3727
"vscode:prepublish": "npm run compile",

inline-completions/src/extension.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function activate(context: vscode.ExtensionContext) {
1717

1818
const result: vscode.InlineCompletionList = {
1919
items: [],
20-
commands: [],
2120
};
2221

2322
let offset = 1;
@@ -48,34 +47,13 @@ export function activate(context: vscode.ExtensionContext) {
4847
result.items.push({
4948
insertText: isSnippet ? new vscode.SnippetString(text) : text,
5049
range: new Range(position.line, startInt, position.line, endInt),
51-
completeBracketPairs,
5250
});
5351
}
5452

5553
if (result.items.length > 0) {
56-
result.commands!.push({
57-
command: 'demo-ext.command1',
58-
title: 'My Inline Completion Demo Command',
59-
arguments: [1, 2],
60-
});
6154
}
6255
return result;
6356
},
64-
65-
handleDidShowCompletionItem(completionItem: vscode.InlineCompletionItem): void {
66-
console.log('handleDidShowCompletionItem');
67-
},
68-
69-
/**
70-
* Is called when an inline completion item was accepted partially.
71-
* @param acceptedLength The length of the substring of the inline completion that was accepted already.
72-
*/
73-
handleDidPartiallyAcceptCompletionItem(
74-
completionItem: vscode.InlineCompletionItem,
75-
acceptedLength: number
76-
): void {
77-
console.log('handleDidPartiallyAcceptCompletionItem');
78-
},
7957
};
8058
vscode.languages.registerInlineCompletionItemProvider({ pattern: '**' }, provider);
8159
}

inline-completions/vscode.proposed.inlineCompletionsAdditions.d.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)