-
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.
feat(Config): Prompt list of files to config extension (#22)
* feat(Config): Prompt list of files to config extension * feat(Command): Add command to update config
- Loading branch information
1 parent
41768f1
commit 05dbe2c
Showing
9 changed files
with
113 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const vscode = require('vscode'); | ||
const { configureFile } = require('../config'); | ||
|
||
function registerCommands() { | ||
vscode.commands.registerCommand( | ||
'alias-resolver.updateConfigFile', | ||
configureFile | ||
); | ||
} | ||
|
||
module.exports = { registerCommands }; |
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 @@ | ||
module.exports = require('./commands').registerCommands; |
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
const ACTIONS = { | ||
CONFIGURE: 'Configure', | ||
CLOSE: 'Close', | ||
}; | ||
const DEFAULT_FILE = 'index'; | ||
const DEFAULT_STYLES_FILE = 'style'; | ||
|
||
module.exports = { | ||
ACTIONS, | ||
DEFAULT_FILE, | ||
DEFAULT_STYLES_FILE, | ||
}; |
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 @@ | ||
module.exports = require('./register-providers').registerProviders; |
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,24 @@ | ||
const vscode = require('vscode'); | ||
const { javascriptProvider } = require('./javascript'); | ||
|
||
function registerProviders(context) { | ||
const { | ||
provideCompletionItems, | ||
provideDefinition, | ||
} = javascriptProvider.providers; | ||
|
||
const completionItemDisposable = vscode.languages.registerCompletionItemProvider( | ||
javascriptProvider.selector, | ||
{ provideCompletionItems }, | ||
...(javascriptProvider.triggerCharacters || []) | ||
); | ||
|
||
const definitionDisposable = vscode.languages.registerDefinitionProvider( | ||
javascriptProvider.selector, | ||
{ provideDefinition } | ||
); | ||
|
||
context.subscriptions.push(completionItemDisposable, definitionDisposable); | ||
} | ||
|
||
module.exports = { registerProviders }; |