3 ms·
I don't care what they do the menus and toolbars one way or the other, so long as they're still able to be customized and hidden, and so long as fonts remain un
by jasomill 3y ago
I don't care what they do the menus and toolbars one way or the other, so long as they're still able to be customized and hidden, and so long as fonts remain universally customizable and resizable.
Increased granularity for font selection would be nice, e.g., using a proportional font for some file types and a monospaced font for others, enabling or disabling ligatures on a per-file type basis, changing fonts or sizes of specific editor and tool windows, etc.
But what I've really wanted since forever is some lightweight extension mechanism that'd allow me to define custom commands and assign them to keystrokes, menu commands, and events — from directly within the IDE, without the overhead of building, testing, and installing a VSIX package.
As a simple example: I'd love to be able to toggle between sets of predefined font selections with a single command, which could be trivially defined in terms of the already existing settings import mechanism, if only there were a simple way to automate it.
Another example: while VS allows me to launch an external command on the current file or project, it'd be nice if it'd allow me to post-process the result into a list or tree view, which, again, would be easily defined in terms of existing IDE functionality, or to filter the current text selection through a function or external program.
Finally, in conjunction with the above, it'd be nice to be able to define custom keyboard shortcuts, menu options, and toolbar buttons in the editor for particular file types, in the spirit of Emacs auto-mode-alist.
In the distant past, a form of what I want existed in terms of VBA macro support in the IDE, but this was removed, IIRC, when they migrated the UI to WPF.
In recent versions, the only way I've been able to do any ad hoc scripting is via the (undocumented) $DTE variable in the NuGet Package Manager Console:
~> ($DTE.ActiveDocument | Get-Member).Name -join ', '
Activate, ClearBookmarks, Close, MarkText, NewWindow, Object, PrintOut, Redo, ReplaceText, Save, Undo, Extender, ActiveWindow, Collection, DTE, ExtenderCATID, ExtenderNames, FullName, IndentSize, Kind, Language, Name, Path, ProjectItem, ReadOnly, Saved, Selection, TabSize, Type, Windows
~> $d = $DTE.ActiveDocument
~> $s = $d.Selection
~> $s.Text
var tokenText = Encoding.UTF8.GetString(
pBuffer + tokenOffset,
endOffset - tokenOffset
);
~> $s.Text -match '^\s*' >$null
~> $s.Unindent(($matches.0).Length / $d.IndentSize)
~> $s.Text
var tokenText = Encoding.UTF8.GetString(
pBuffer + tokenOffset,
endOffset - tokenOffset
);
~>
But even if I could find a way to use this to create assignable commands, using arbitrary COM objects from PowerShell can be painful.