From 1f49e7f3920755bdcfc09318bb73ba4d5424dfa5 Mon Sep 17 00:00:00 2001 From: Paul Harrington Date: Fri, 26 Jan 2024 22:19:40 -0800 Subject: [PATCH] Add Dev17 overview and publish manifest Publish both VSIXes from PublichVSIX.yml --- .github/workflows/PublishVSIX.yml | 25 ++++++--- marketplace/overview.Dev17.md | 73 ++++++++++++++++++++++++++ marketplace/publishManifest.Dev17.json | 27 ++++++++++ src/Editor Guidelines.sln | 2 + 4 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 marketplace/overview.Dev17.md create mode 100644 marketplace/publishManifest.Dev17.json diff --git a/.github/workflows/PublishVSIX.yml b/.github/workflows/PublishVSIX.yml index c552875..9c2354a 100644 --- a/.github/workflows/PublishVSIX.yml +++ b/.github/workflows/PublishVSIX.yml @@ -1,5 +1,10 @@ name: Publish to VS Marketplace +# Triggered by a new GitHub Release being published. It expects to find +# two .visx assets in the Release: +# EditorGuidelines.vsix and +# EditorGuidelines.Dev17.vsix + on: release: types: [published] @@ -13,15 +18,23 @@ jobs: with: fetch-depth: 0 - - name: Publish release to marketplace + - name: Fetch latest release assets + uses: dsaltares/fetch-gh-release-asset@1.1.1 + with: + file: *.vsix + + - name: Publish to VS marketplace id: publish uses: mrluje/vs-marketplace-publisher@v2 with: - # (Required) Personal access token to perform action on the VS Marketplace pat: ${{ secrets.vs_pat }} - - # (Required) Path to the manifest used for the publish manifestPath: marketplace/publishManifest.json + vsixPath: EditorGuidelines.vsix - # (Optional) Fetch the latest release container a vsix package for upload to the VS Marketplace - useLatestReleaseAsset: true + - name: Publish Dev17 to marketplace + id: publish + uses: mrluje/vs-marketplace-publisher@v2 + with: + pat: ${{ secrets.vs_pat }} + manifestPath: marketplace/publishManifest.Dev17.json + vsixPath: EditorGuidelines.Dev17.vsix diff --git a/marketplace/overview.Dev17.md b/marketplace/overview.Dev17.md new file mode 100644 index 0000000..e56dd70 --- /dev/null +++ b/marketplace/overview.Dev17.md @@ -0,0 +1,73 @@ +Editor Guidelines adds vertical column guides behind your code. This is useful if you are trying to tabulate columns of data or if you want to ensure that your lines don't extend beyond a certain length. You specify where the guides go and what color they should be. + +_Note: This version is specifically for Visual Studio 2022._ + +_Note: This extension collects and transmits anonymized usage statistics to the extension author for product improvement purposes._ + +## Getting Started +Add a new guideline via the context (right-click) menu on the editor surface. You will see a "Guidelines" flyout with three commands: + +![Context Menu](images/ContextMenu.png) + +When "Add Guideline" is selected, a vertical dashed line will be drawn at the same position as the caret (insertion point). + +"Remove Guideline" will remove any guideline at the current insertion point. + +"Remove All Guidelines" does exactly that. + +## Configuration +You can change the guideline color from the Fonts and Colors page in Tools/Options. Look for "Guideline" in the Text Editor category: + +![Fonts and Colors](images/FontsAndColors.png) + +## .editorconfig support (VS 2017 and above) +For VS 2017 and above, the position of guidelines can be overridden via settings in .editorconfig files. +Set the `guidelines` property to a list of column values. The following example sets guidelines at columns 80 and 120 for C# and VB files and a single guideline at column 80 for all other files. + +```ini +# All files +[*] +guidelines = 80 + +# C# or VB files +[*.{cs,vb}] +guidelines = 80, 120 +``` + +You can set the guideline style like this: +```ini +[*] +# Named color format +guidelines_style = 1px dotted black + +[*.{cs,vb}] +# ARGB color format (red with 25% opacity) +guidelines_style = 2.5px solid 40ff0000 +``` +As shown, you can have different styles for different file types. There are three different drawing styles: +- solid +- dotted +- dashed + +As the examples show, colors may be named or in RGB or ARGB (hexadecimal) format. The available color names are from WPF's Colors collection (System.Windows.Media.Colors). + +As the following example shows, you can set the style for each guideline separately. Three guidelines are defined. The first two define custom styles. The third, at column 132 doesn't specify a style, so it will be drawn using the default style which, if not specified via `guidelines_style`, will take its color from Fonts & Colors. + +```ini +[*] +guidelines = 40 1px dotted black, 80 10px solid 30B0ED4C, 132 +``` + +To learn more about .editorconfig see https://aka.ms/editorconfigdocs + +**Note:** When guidelines are set via .editorconfig they override any other guidelines set via the context menus or command window. + +## Advanced +These commands may also be accessed from Visual Studio's Command Window + +![Command Window](images/CommandWindow.png) + +Note that the column numbers used for the Edit.AddGuideline and Edit.RemoveGuideline commands refer to the right side of the given column of text. i.e. To place a guide to the right of column 80, use "Edit.AddGuideline 80". To place a guide to the left of the first column use "Edit.AddGuideline 0". + +## Support +If you find a bug in this extension or have a feature request, please visit https://github.com/pharring/EditorGuidelines to file an issue. diff --git a/marketplace/publishManifest.Dev17.json b/marketplace/publishManifest.Dev17.json new file mode 100644 index 0000000..872c4ad --- /dev/null +++ b/marketplace/publishManifest.Dev17.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json.schemastore.org/vsix-publish", + "categories": [ "coding", "other" ], + "identity": { + "internalName": "EditorGuidelinesPreview" + }, + "overview": "overview.Dev17.md", + "priceCategory": "free", + "publisher": "PaulHarrington", + "private": false, + "qna": true, + "repo": "https://github.com/pharring/EditorGuidelines", + "assetFiles": [ + { + "pathOnDisk": "images/ContextMenu.png", + "targetPath": "images/ContextMenu.png" + }, + { + "pathOnDisk": "images/FontsAndColors.png", + "targetPath": "images/FontsAndColors.png" + }, + { + "pathOnDisk": "images/CommandWindow.png", + "targetPath": "images/CommandWindow.png" + } + ] +} \ No newline at end of file diff --git a/src/Editor Guidelines.sln b/src/Editor Guidelines.sln index 62ec851..d77d915 100644 --- a/src/Editor Guidelines.sln +++ b/src/Editor Guidelines.sln @@ -18,7 +18,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "marketplace", "marketplace", "{205F9C77-7D58-42CD-A882-5D73C40E6184}" ProjectSection(SolutionItems) = preProject + ..\marketplace\overview.Dev17.md = ..\marketplace\overview.Dev17.md ..\marketplace\overview.md = ..\marketplace\overview.md + ..\marketplace\publishManifest.Dev17.json = ..\marketplace\publishManifest.Dev17.json ..\marketplace\publishManifest.json = ..\marketplace\publishManifest.json EndProjectSection EndProject