-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref #5 Experimenting save highlights feature
- Loading branch information
Showing
6 changed files
with
96 additions
and
1 deletion.
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,16 @@ | ||
|
||
class SaveAllHighlightsCommand { | ||
|
||
constructor(params) { | ||
this._configStore = params.configStore; | ||
this._decorationRegistry = params.decorationRegistry; | ||
} | ||
|
||
execute() { | ||
const decorations = this._decorationRegistry.retrieveAll(); | ||
return this._configStore.set('savedHighlights', decorations); | ||
} | ||
|
||
} | ||
|
||
module.exports = SaveAllHighlightsCommand; |
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,35 @@ | ||
|
||
const ConfigurationTarget = { | ||
Global: 1, | ||
Workspace: 2 | ||
}; | ||
|
||
class ConfigurationTargetPicker { | ||
|
||
constructor(params) { | ||
this._windowComponent = params.windowComponent; | ||
} | ||
|
||
pick() { | ||
const selectItems = this._buildQuickPickItems(); | ||
const options = {placeHolder: 'Select which scope of settings to save highlights to'}; | ||
return this._windowComponent.showQuickPick(selectItems, options) | ||
.then(item => item ? item.value : null); | ||
} | ||
|
||
_buildQuickPickItems() { | ||
return [ | ||
{ | ||
label: 'Global', | ||
value: ConfigurationTarget.Global | ||
}, | ||
{ | ||
label: 'Workspace', | ||
value: ConfigurationTarget.Workspace | ||
} | ||
]; | ||
} | ||
|
||
} | ||
|
||
module.exports = ConfigurationTargetPicker; |
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