This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from coveo/code_completion
Code completion #3
- Loading branch information
Showing
13 changed files
with
6,291 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import vscode = require('vscode') | ||
import {VisualforceComponentCacheInstance} from '../symbols/visualforceComponentCache' | ||
|
||
export class VisualforceCompletionItemProvider implements vscode.CompletionItemProvider { | ||
public constructor() { | ||
vscode.languages.setLanguageConfiguration("visualforce", { | ||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\'\"\,\.\<\>\/\?\s]+)/g | ||
}); | ||
} | ||
|
||
public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable<vscode.CompletionItem[]> { | ||
return new Promise<vscode.CompletionItem[]>((resolve, reject) => { | ||
var completionItems: vscode.CompletionItem[] = []; | ||
|
||
VisualforceComponentCacheInstance.getComponentNames().forEach(cmp => { | ||
var completionItem = new vscode.CompletionItem(cmp); | ||
completionItem.kind = vscode.CompletionItemKind.Class; | ||
completionItem.insertText = completionItem.label + "></" + completionItem.label + ">"; | ||
|
||
completionItems.push(completionItem); | ||
}); | ||
resolve(completionItems); | ||
}); | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.