Closed siegebell closed 6 years ago
@siegebell the January update will support for font ligatures, this might help for your scenario, please give it a try.
@egamma: font ligatures won't really help me.
Use case: The Coq Proof Assistant allows one to write proofs about mathematics (category theory, real numbers, etc.), program behavior, program logics, type systems, etc. I am writing an extension to work with Coq proofs in vscode. It would be useful for the user to be able to define a set of symbol substitutions particular to the domain that they are writing proofs about. For example, set notation is useful for visualizing proofs about set theory.
Limitations of ligatures for symbol substitutions:
Solution:
DecorationRenderOptions
to allow the rendered text to be completely replaced by another string or image/svg. Then I could implement a "prettify symbols mode" extension myself.@siegebell no doubt prettify symbols is more powerful than ligatures. Thanks for the clarifications.
@egamma @aeschli - I've managed to implement a rudimentary prettify symbols mode using #7181 (before & after decorations) -- thanks!
But there are a couple bugs in #7181 and limitations elsewhere that need to be addressed, so I'll be filing a few more related issues soon.
Most of the features can be implemented as an extension, but here are a couple reasons it might be better to implement this in vscode itself:
'cursorLeft'
command, but there seems to be no way to restore the original behavior, or I can set up keybindings that hook cursor movement keys. Neither of these options play well with potential extensions that change cursor movement behavior or a user's custom keybindings that choose alternatives to e.g. the left key (e.g. the vim extensions).display: none
and font-size: 0pt
to hide text, and both cause the cursor to disappear when at the left or right edges of the range where such a decoration is applied.But my preference would be to have a supported way to hide text (e.g. through decorations) that handles cursor movement and cursor visibility properly, and then leave the rest to an extension.
:+1: on implementing this in the core. Sounds like something the ViewModel should do -- it has the ability to transform view <-> model positions and randomly insert/remove text, etc.
Note: it is not trivial
@alexandrudima @aeschli this could also be resolved by #3422 if it gives extensions a flexible API to control code folding.
The API would need to allow specifying:
@alexandrudima If I were to attempt a PR to support hiding text, do you think adding it as a decoration property would be a good idea?
E.g. add foldContent: boolean
to ThemableDecorationRenderOptions
? Unlike display: none
, the behavior would not hide the attachments.
This feature could in theory satisfy both Allow Unicode Operators and Remove Fun Keyword. Really hoping this feature gets implemented at some point.
@voronoipotato check it out: https://marketplace.visualstudio.com/items?itemName=siegebell.prettify-symbols-mode.
+1
To keep the number of issues in our inbox at a manageable level, we're closing issues that have been on the backlog for a long time but haven't gained traction: we look at the number of votes the issue has received and the number of duplicate issues filed. Thank you for your time and understanding.
P.S. If you disagree and feel that this issue is crucial: we're happy to listen and to reconsider.
Feature request: Emacs has a cool feature called "prettify symbols mode," demonstrated for Haskell here. This could also subsume #192.
The basic idea is to register a sequence of characters whose glyphs will be replaced with another glyph, but the original characters still appear in the text document. Ideally, the substitutions would be dependent on the context returned by a syntax highlighter or some other parser.