Files

119 lines
5.9 KiB
Markdown
Raw Permalink Normal View History

2017-10-20 13:56:58 +02:00
# Configuration Sample Extension
This sample shows
- How to define a `window`, `resource` and `language-overridable` scoped configurations.
2017-10-20 13:56:58 +02:00
- How to read and update a `window` scoped configuration
- How to read a `resource` scoped configuration of a resource
- How to update a value for `resource` scoped configuration of a resource
- How to read a `language-overridable` scoped configuration
- How to override a `language-overridable` scoped configuration under a language
2017-10-20 13:56:58 +02:00
- How to listen to configuration changes
- How to test it
2017-10-20 15:51:04 +02:00
See [extension.ts](./src/extension.ts)
2017-10-20 13:51:32 +02:00
# Testing
## Empty Workspace
Explains how to test this extension in an Empty workspace
2017-10-20 15:39:40 +02:00
### Testing Window configuration
- Open User Settings and set `"conf.view.showOnWindowOpen": "scm"`
- Refresh the Window. SCM view will be shown always, even if you refresh from a view other than SCM.
- Run the command `Configure view to show on window open` and Select the value (View to show when opening a window)
- Value should be updated in `User Settings`
### Testing Resource configuration
- Open User Settings and set `"conf.resource.insertEmptyLastLine": {"${absolute_path_to_file}": true}`
- Open the above configured file in the empty window. A message about adding empty line from the extension is shown.
- Open a different file. No message is shown.
- Run the command `Configure empty last line for current file`
- Value in User settings is updated. Message is shown now
2021-09-16 20:23:10 +08:00
- Run the command `Configure empty last line for files` and provide absolute path of another file
2017-10-20 15:39:40 +02:00
- Value should be updated in User Settings
### Testing Language Specific configuration
- Set `"conf.language.showSize": true` in user settings
- Open a file and you should see the size of the file in the status
- Unset `conf.language.showSize`
- Run the command `Configuration Sample: Configure show size for language`
- Enter the language for which you want to configure this feature and press Enter.
- Open a file with above configured language and size of the file is shown in status
- Open a file with a different language and no status is shown.
2017-10-20 13:51:32 +02:00
## Folder Workspace
Explains how to test this extension in a Folder workspace
2017-10-20 15:39:40 +02:00
### Testing Window configuration
- Open User or Workspace Settings and set `"conf.view.showOnWindowOpen": "scm"`
- Refresh the Window. SCM view will be shown always, even if you refresh from a view other than SCM.
- Run the command `Configure view to show on window open`. Select the value (View to show when opening a window)
- Pick the target `User Settings` or `Workspace Settings` into which the value should be updated
- Value should be updated in selected target
### Testing Resource configuration
- Open User Settings and set `"conf.resource.insertEmptyLastLine": {"${absolute_path_to_file}": true}`
- Open the above configured file in the empty window. A message about adding empty line from the extension is shown.
- Open a different file from the opened folder. No message is shown.
- Run the command `Configure empty last line for current file`
- Value in Workspace settings is updated. Message is shown now.
2021-09-16 20:23:10 +08:00
- Run the command `Configure empty last line for files` and provide absolute path of another file.
2017-10-20 15:39:40 +02:00
- Pick the target `User Settings` or `Workspace Settings` into which the value should be updated
- Value should be updated in selected target
### Testing Language Specific configuration
- Set `"conf.language.showSize": true` in any settings (user, workspace)
- Open a file and you should see the size of the file in the status
- Unset `conf.language.showSize`
- Run the command `Configuration Sample: Configure show size for language`
- Enter the language for which you want to configure this feature and press Enter.
- Open a file with above configured language and size of the file is shown in status
- Open a file with a different language and no status is shown.
2017-10-20 13:51:32 +02:00
### Multiroot Workspace
Explains how to test this extension in a Multiroot workspace
2017-10-20 15:39:40 +02:00
### Testing Window configuration
- Open User or Workspace Settings and set `"conf.view.showOnWindowOpen": "scm"`
- Refresh the Window. SCM view will be shown always, even if you refresh from a view other than SCM.
- *NOTE*: This setting cannot be applied under Folder settings, doing so will show a warning and value is not respected.
- Run the command `Configure view to show on window open`. Select the value (View to show when opening a window)
- Pick the target `User Settings` or `Workspace Settings` into which the value should be updated
- Value should be updated in selected target
### Testing Resource configuration
- Open User Settings and set `"conf.resource.insertEmptyLastLine": {"${absolute_path_to_file}": true}`
- Open the above configured file in the empty window. A message about adding empty line from the extension is shown.
- Open a different file from one of the root folders. No message is shown.
- Run the command `Configure empty last line for current file`
- Value in Folder Settings of the root folder of the current file is updated. Message is shown now.
2021-09-16 20:23:10 +08:00
- Run the command `Configure empty last line for files` and provide absolute path of another file.
2017-10-20 15:39:40 +02:00
- Pick the target `User Settings` or `Workspace Settings` or `Workspace Folder Settings` into which the value should be updated
- Selecting User or Workspace Settings should update the value in respective targets.
- Selecting Workspace Folder Settings will show a Workspace Folder Picker
- Picking a workspace folder should update the value in the respective folder settings file.
### Testing Language Specific configuration
- Set `"conf.language.showSize": true` in any settings (user, workspace or workspace folder)
- Open a file and you should see the size of the file in the status
- Unset `conf.language.showSize`
- Run the command `Configuration Sample: Configure show size for language`
- Enter the language for which you want to configure this feature and press Enter.
- Open a file with above configured language and size of the file is shown in status
- Open a file with a different language and no status is shown.