Skip to content

Conversation

@veler
Copy link
Collaborator

@veler veler commented Mar 4, 2025

This PR adds a new Encode / Decode Base64 sample.

image
image

I'm considering adding selection restoration. Looking with @olegtk on how it works.

@veler veler requested review from Copilot and matteo-prosperi March 4, 2025 21:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR adds a new sample extension that demonstrates how to encode and decode Base64 text within Visual Studio. The key changes include:

  • Adding an extension entry point (EncodeDecodeBase64Extension.cs) with metadata registration.
  • Introducing a command (EncodeDecodeBase64Command.cs) that processes selected text by encoding or decoding it between plain text and Base64.
  • Providing a README.md that explains the sample’s functionality, command definition, usage, and relevant guidelines.

Reviewed Changes

File Description
New_Extensibility_Model/Samples/EncodeDecodeBase64/EncodeDecodeBase64Extension.cs Registers the extension with proper metadata for Visual Studio.
New_Extensibility_Model/Samples/EncodeDecodeBase64/README.md Documents the sample usage, command definition, and walkthrough.
New_Extensibility_Model/Samples/EncodeDecodeBase64/EncodeDecodeBase64Command.cs Implements the command logic that encodes or decodes Base64 text from the active editor.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

New_Extensibility_Model/Samples/EncodeDecodeBase64/EncodeDecodeBase64Command.cs:77

  • Allocating a buffer using stackalloc based on the input text length may cause a stack overflow for very large inputs. Consider validating the input size or switching to heap allocation for longer texts.
Span<byte> buffer = stackalloc byte[text.Length];

@veler veler merged commit 9789821 into main Mar 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants