forked from mattkenefick/vscode-box-comment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62bd33f
commit 13547bf
Showing
17 changed files
with
1,221 additions
and
247 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
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,29 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
// Get settings | ||
const settings = vscode.workspace.getConfiguration('box-comment'); | ||
|
||
// This can be changed per language, so JS can have less than another | ||
const chars = settings?.chars || {}; | ||
const indentAmount: number = settings?.indentation || 2; | ||
|
||
export default { | ||
CHAR_BL: chars.bl || '└', | ||
CHAR_BM: chars.bm || '─', | ||
CHAR_BR: chars.br || '┘', | ||
CHAR_DL: chars.dl || '├', | ||
CHAR_DM: chars.dm || '─', | ||
CHAR_DR: chars.dr || '┤', | ||
CHAR_L: chars.l || '│', | ||
CHAR_R: chars.r || '│', | ||
CHAR_TL: chars.tl || '┌', | ||
CHAR_TM: chars.tm || '─', | ||
CHAR_TR: chars.tr || '┐', | ||
TOTAL_LINE_LENGTH: settings?.length || 80, | ||
indent: ' '.repeat(indentAmount), | ||
indentAmount: indentAmount, | ||
linebreak: { | ||
after: settings?.linebreak?.after ? `\n` : '', | ||
before: settings?.linebreak?.before ? `\n` : '', | ||
}, | ||
}; |
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,21 @@ | ||
import * as vscode from 'vscode'; | ||
|
||
/** | ||
* Creates a native comment of our current selection | ||
* | ||
* @return void | ||
*/ | ||
export function commentSelection(): void { | ||
vscode.commands.executeCommand('editor.action.blockComment'); | ||
|
||
// vscode.commands.executeCommand('editor.action.addCommentLine'); | ||
} | ||
|
||
/** | ||
* Removes a native comment of our current selection | ||
* | ||
* @return void | ||
*/ | ||
export function uncommentSelection(): void { | ||
vscode.commands.executeCommand('editor.action.blockComment'); | ||
} |
Oops, something went wrong.