Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-LIFE-195

The editor association of Markdown files is restored once from the retired Studio setting

When the extension activates and the user or the workspace settings hold the retired setting open.markdownFilesInStudio turned on, the extension SHALL write the workbench.editorAssociations entry *.md naming the Studio editor in that scope before it removes the retired setting from that scope, leave every other entry untouched, remove the leftover retired settings, and show nothing to the reader.

Step 1 of path 3 in StRS-MDOKFSTUDIO-LIFE-023: from “The reader's user or workspace settings hold the retired setting Open Markdown files in Studio, on” to “The reader's Markdown files open in Studio through the association of VS Code”.

Scenarios 2

The situations the tests check; open one to read it.

nominalA user setting is turned into the association
Giventhe user settings hold open.markdownFilesInStudio on and open.searchResultsInStudio, and workbench.editorAssociations with *.png naming another editor
Whenthe extension activates
Thenthe user settings hold workbench.editorAssociations with *.png kept and *.md naming the Studio editor, neither retired setting is left, and nothing is shown to the reader
boundaryWhat is written and what is not
InputOutcome
no association in the scopethe association becomes the single entry *.md for the Studio editor
an association object without *.mdthe entry is added after the others, which keep their order
the legacy array form with no *.md itemthe item with the Studio view type and the pattern *.md is appended
*.md already names the Studio editor, or another editornothing is written to the association, the other editor stays, and the retired setting is still removed
the user scope and the workspace scope both hold the setting oneach scope gets the association and loses its setting; a workspace that held it off while the user held it on only loses its value, so the user association then applies in that workspace
a setting that is off, or open.searchResultsInStudio whatever its valueno association is written and the value is removed from that scope
the setting is off in every scope, or was never storednothing is written at all
the association write failsthe retired setting stays in that scope, the failure is logged, nothing is shown, the other scope still restores, and the next activation tries again
the association has any other shape, not an object nor an arraynothing is written there, the retired setting of that scope stays, the cause is logged and nothing is shown
a second activationnothing is written, because the retired setting is the only mark
the store keys markdownOkfSchemaStudio.migrations.editorAssociation of an older versionremoved from the global and the workspace state when they exist
a host without the setting writernothing happens
any key other than the Studio settings and workbench.editorAssociations, or a markdown.preview settingthe host writer refuses it without writing

Implemented in 2

Tested by 5

Replaces

SwRS-MDOKFSTUDIO-LIFE-175The editor association of Markdown files is migrated to the Studio setting once per scope superseded superseded by SwRS-MDOKFSTUDIO-LIFE-195 Markdown file