Skip to content

Commit 96eaab2

Browse files
committedOct 26, 2022
feat: Move what's new to a button vs Markdown
Fixes #723
1 parent 1085756 commit 96eaab2

8 files changed

+19
-633
lines changed
 

‎.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ venv/
1919

2020
# UI tests
2121
test-resources/
22+
23+
# Location where local release notes are stored
24+
updates/

‎CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4747

4848
### Changed
4949

50+
- Changed the way extension Release Notes are displayed
51+
([#723](https://github.com/fortran-lang/vscode-fortran-support/issues/723))
5052
- Changed the activation events of the extension to include the `onCommand` for all register commands
5153
- Changed glob resolution module to `glob` from `fast-glob` due to bug #43
5254
([#681](https://github.com/fortran-lang/vscode-fortran-support/issues/681))

‎src/extension.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ export async function activate(context: vscode.ExtensionContext) {
113113
!fs.existsSync(path.join(__dirname, 'displayReleaseNotes.txt')) &&
114114
config.get<boolean>('notifications.releaseNotes')
115115
) {
116-
await showWhatsNew();
116+
const whatsNew = `Show What's New`;
117+
const notAgain = `Don't show again`;
118+
vscode.window
119+
.showInformationMessage('🎉 New Release: Modern Fortran 🎉', whatsNew, notAgain)
120+
.then(selection => {
121+
if (selection === whatsNew) {
122+
showWhatsNew();
123+
} else if (selection === notAgain) {
124+
config.update('notifications.releaseNotes', false, true);
125+
}
126+
});
117127
fs.writeFileSync(path.join(__dirname, 'displayReleaseNotes.txt'), 'false');
118128
}
119-
// const GoToHelp = 'Go to Help';
120-
// vscode.window.showInformationMessage('Click for more Info', GoToHelp).then(selection => {
121-
// if (selection === GoToHelp) {
122-
// vscode.env.openExternal(
123-
// vscode.Uri.parse(
124-
// 'https://github.com/fortran-lang/vscode-fortran-support/blob/main/updates/RELEASE_NOTES-v3.2.md'
125-
// )
126-
// );
127-
// }
128-
// });
129129
return context;
130130
}
131131

@@ -183,6 +183,7 @@ function detectDeprecatedOptions() {
183183
}
184184

185185
async function showWhatsNew() {
186-
const uri = vscode.Uri.file(path.join(__dirname, '../updates/RELEASE_NOTES-unreleased.md'));
187-
vscode.commands.executeCommand('markdown.showPreview', uri);
186+
vscode.env.openExternal(
187+
vscode.Uri.parse('https://github.com/fortran-lang/vscode-fortran-support/wiki/Pre-Release')
188+
);
188189
}

‎updates/RELEASE_NOTES-unreleased.md

Lines changed: 0 additions & 212 deletions
This file was deleted.

0 commit comments

Comments
 (0)