Skip to content

Commit 0769df7

Browse files
Update provider documentation
1 parent 0b862c1 commit 0769df7

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/providers/CompletionProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ export default class CompletionProvider {
1616
return;
1717
}
1818

19-
// Disable suggestions if the user has turn them off
19+
// Disable suggestions if the user has turned them off
2020
if (!ConfigService.suggestionsEnabled()) {
2121
return Promise.resolve([]);
2222
}
2323

24+
// Iterate over the completions and build as needed
2425
for (let completion of Completions.default) {
2526
const channelProvider = vscode.languages.registerCompletionItemProvider({ scheme: 'file', language: 'ee' }, {
2627
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position) {
27-
28+
29+
// Get the text at the cursor position
2830
let linePrefix = document.lineAt(position).text.substr(0, position.character);
2931

32+
// If the line does not end with the prefix and the line does not contain the prefix return
3033
if (!linePrefix.endsWith(completion.prefix) && !/^{exp:channel}/.test(document.lineAt(position).text)) {
3134
return undefined;
3235
}

src/providers/GlobalVariableProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class GlobalVariableProvider {
1616
return;
1717
}
1818

19-
// Disable suggestions if the user has turn them off
19+
// Disable suggestions if the user has turned them off
2020
if (!ConfigService.suggestionsEnabled()) {
2121
return Promise.resolve([]);
2222
}

src/providers/ParameterProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ export default class ParameterProvider {
1616
return;
1717
}
1818

19-
// Disable suggestions if the user has turn them off
19+
// Disable suggestions if the user has turned them off
2020
if (!ConfigService.suggestionsEnabled()) {
2121
return Promise.resolve([]);
2222
}
2323

24+
// Iterate over the completions and build as needed
2425
for (let completion of Completions.default) {
2526
const parameterProvider = vscode.languages.registerCompletionItemProvider({ scheme: 'file', language: 'ee' }, {
2627
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext) {

0 commit comments

Comments
 (0)