Skip to content

Commit

Permalink
Added electric characters & closing character pairs fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Jan 4, 2016
1 parent 7097be8 commit 54e1887
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-d",
"description": "auto-complete, snippets, linter and formatter for dlang",
"version": "0.2.1",
"version": "0.2.2",
"publisher": "webfreak",
"repository": {
"type": "git",
Expand Down
22 changes: 22 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.languages.registerDocumentFormattingEditProvider(D_MODE, workspaced));
context.subscriptions.push(workspaced);

vscode.languages.setLanguageConfiguration(D_MODE.language, {
__electricCharacterSupport: {
brackets: [
{ tokenType: 'delimiter.curly.ts', open: '{', close: '}', isElectric: true },
{ tokenType: 'delimiter.square.ts', open: '[', close: ']', isElectric: true },
{ tokenType: 'delimiter.paren.ts', open: '(', close: ')', isElectric: true }
]
},

__characterPairSupport: {
autoClosingPairs: [
{ open: '{', close: '}' },
{ open: '[', close: ']' },
{ open: '(', close: ')' },
{ open: '`', close: '`', notIn: ['string'] },
{ open: '"', close: '"', notIn: ['string'] },
{ open: '\'', close: '\'', notIn: ['string', 'comment'] }
]
}
});


context.subscriptions.push(vscode.languages.registerWorkspaceSymbolProvider(workspaced));

diagnosticCollection = vscode.languages.createDiagnosticCollection("d");
Expand Down

0 comments on commit 54e1887

Please sign in to comment.