Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Add deprecation notice and migration guide (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaciazek authored Feb 6, 2022
1 parent 81d31e2 commit 06f5bde
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to the Ansible VS Code extension will be documented in this
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2022-02-06
### Added
- Deprecation notification, and migration guide.

## [1.1.0] - 2021-11-14
### Added
- Nested module options (aka sub-options) are now supported!
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# Deprecation notice
This extension has been deprecated in favor of
[Ansible](https://marketplace.visualstudio.com/items?itemName=redhat.ansible)
extension published by Red Hat.

For more details please see [this discussion](https://github.com/tomaciazek/vscode-ansible/discussions/43).

Let me know in the comments if this extension has helped you ;)

## Migration guide
1. Uninstall this extension
2. Reload VS Code (from *Command Palette* or using button visible in the
*Extensions* pane next to this extension)
3. Install the [extension published by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.ansible)
4. Adjust extension configuration:
- The default setting for **Ansible: Use Fully Qualified Collection Names**
changed to `true`. If you haven't set it explicitly to `false` and you'd
like to retain the old behavior, you'll need to set it to `false`.
> NOTE: Official recommendation (in Ansible documentation) is to use FQCNs.
- The following settings are no longer available in the **User** scope, you
will need to move them to one of the other scopes:
- **Ansible: Path**
- **Ansible Lint: Path**
- **Python: Activation Script**
- **Python: Interpreter Path**
5. Adjust `files.associations` if some of your YAML files get incorrectly
associated with Ansible

# Ansible VS Code Extension
This extension adds language support for Ansible to VS Code.

Expand Down
18 changes: 18 additions & 0 deletions client/src/deprecationNotice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ExtensionContext, window } from 'vscode';

export const DEPRECATION_DISMISSED = 'deprecationMessage.dismissed';

export async function showDeprecationNotification(
context: ExtensionContext
): Promise<void> {
if (!context.globalState.get(DEPRECATION_DISMISSED, false)) {
const choice = await window.showWarningMessage(
'This extension has been deprecated in favor of another. See migration guide on the marketplace page.',
'Remind me later',
'Dismiss'
);
if (choice === 'Dismiss') {
context.globalState.update(DEPRECATION_DISMISSED, true);
}
}
}
8 changes: 8 additions & 0 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import {
ServerOptions,
TransportKind,
} from 'vscode-languageclient/node';
import {
DEPRECATION_DISMISSED,
showDeprecationNotification,
} from './deprecationNotice';

let client: LanguageClient;

Expand Down Expand Up @@ -39,8 +43,12 @@ export function activate(context: ExtensionContext): void {
clientOptions
);

context.globalState.setKeysForSync([DEPRECATION_DISMISSED]);

// start the client and the server
client.start();

showDeprecationNotification(context);
}

export function deactivate(): Thenable<void> | undefined {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "ansible",
"publisher": "tomaciazek",
"displayName": "Ansible",
"displayName": "[DEPRECATED] Ansible",
"description": "Ansible language support",
"author": "Tomasz Maciążek",
"license": "MIT",
"version": "1.1.0",
"version": "1.2.0",
"repository": {
"type": "git",
"url": "https://github.com/tomaciazek/vscode-ansible.git"
Expand Down

0 comments on commit 06f5bde

Please sign in to comment.