Last CharA lightweight Visual Studio Code extension that instantly reveals the last non-whitespace character in the currently open file, together with its Unicode code point. Built as a small developer utility and as a demonstration of working with the Visual Studio Code Extension API. Features
ExampleGiven a file ending with:
Run: Last Char: Reveal Last Character The extension displays:
Unicode characters are supported as well:
Result:
Usage
InstallationInstall from VSIXDownload the
Run from sourceClone or download this repository and open the project directory in Visual Studio Code. Press You can then run Last Char: Reveal Last Character from the Command Palette in the development window. Project Structure
How It WorksThe extension uses the VS Code Extension API to access the active text editor and retrieve the contents of the current document. Trailing whitespace is removed before the final character is determined.
The Unicode value is then obtained using Technologies
DevelopmentThe extension command is registered using:
The command is exposed to Visual Studio Code through the BuildingInstall Microsoft's VS Code Extension Manager:
Package the extension:
This generates an installable MotivationLast Char intentionally focuses on doing one thing well. The project demonstrates the complete lifecycle of a small Visual Studio Code extension: designing a utility, integrating with the VS Code API, handling Unicode correctly, debugging through the Extension Development Host, packaging the extension as a VSIX, and installing it as a standalone extension. Future ImprovementsPotential additions include:
LicenseMIT |