Comments (11)
It is possible to make such kind of decorations via the syntax highlight to decorate a category of syntax elements, for instance, all static
members like the above, or all member declarations, which can be implemented easily and you have seen the result in my above post. However, to decorate a specific symbol, for instance, the DateTime
struct or ConcurrentDictionary<,>
class only, things can be much more complicated. Performance penalty will not be avoided since many symbol comparisons will occur.
There's already an existing similar implementation in Codist that I myself seldom use. If you enable the Smart Bar feature, select a symbol and click the Mark Symbol command on the Smart Bar, you can mark that symbol with one of the 9 predefined but customizable syntax styles. The decoration can be implemented into those "predefined" styles, so when you "Mark" a symbol, the above decoration can be applied to it.
Summary: It should not be very hard to implement, if we take the above implementations that we already have: Mark Symbol + Syntax Highlight, but available styles are limited to 9 (the number can be enlarged without great efforts though). What's left undone is the various decoration styles suggested in your comments (font family and style, font size, color, opacity, alignments, decoration text, etc.), the configuration module and persistence of marked symbols.
Actually I am attempting to squeeze some time to implement the #231.
from codist.
Thank you very much for this wonderful suggestion.
It is possible to render it with a text on top of the decorated text.
You may take a look at the following quick demo.
However, will the decorations be distracting?
from codist.
@fitdev
Any comment, my friend?
from codist.
That looks pretty good!
Would it also be possible to customize the font alpha (opacity) and font size?
I think this feature should be selectively applied:
- manually: the user could right click on an element to toggle the feature. Maybe it could also be an option in the Super Quick Info dialog?
- automatically: applies when an element satisfies conditional criteria. For example, if the element name matches a regex pattern, or if the element name contains a substring.
I appreciate the work you put into this extension!
from codist.
I saw this feature yesterday and wanted to comment, but decided to wait a bit. Thank you for asking :)
I do like it in general! Provided it can be:
- Optional - that is it can be completely disabled. Or customizable - i.e. by default there will be no such "decorations", but a user can specify them in a similar fashion as can be done now for font styles and colors.
- It should not adversely affect performance.
Ideally such decorations should be selectable from a set of predefined symbols/icons/glyphs; or can be defined by user text instead, where a user provides text, color, and maybe font style.
And in all cases position / alignment should be selectable, likely from 2 to 6 possibilities: Above/Below x Left/Center/Right.
Hopefully it won;t be too hard to implement by extending the current notion of user defined syntax highlights.
Though in terms of priorities, I would prefer an update on symbol searching / browsing first (i.e. Object-Browser like functionality with all the goodies that are currently available via context menus).
from codist.
However, to decorate a specific symbol, for instance, the DateTime struct or ConcurrentDictionary<,> class only, things can be much more complicated. Performance penalty will not be avoided since many symbol comparisons will occur.
Personally I am not interested as much in such a specific scenario.
However, for such custom styles, maybe an additional area / tab can be used to define them similar to how Comment Tagger is implemented. So, for example a specific syntax element kind (like a 'class' for example) + a user-defined RegEx = a certain user-defined style. This is just an idea about how this might be surfaced. But again, this level of customization is not really something I would be using often.
There's already an existing similar implementation in Codist that I myself seldom use. If you enable the Smart Bar feature, select a symbol and click the Mark Symbol command on the Smart Bar, you can mark that symbol with one of the 9 predefined but customizable syntax styles. The decoration can be implemented into those "predefined" styles, so when you "Mark" a symbol, the above decoration can be applied to it.
I didn't know about that. Thank you for mentioning it.
Actually I am attempting to squeeze some time to implement the #231
That's great to know!
from codist.
a specific syntax element kind (like a 'class' for example) + a user-defined RegEx = a certain user-defined style
Hmm, it was discussed in #266.
this level of customization is not really something I would be using often.
Thank you for your comment.
I have the same feeling as well.
@Decimation
Could you show some potential usage, logically, how this feature will be used, if it is implemented?
from codist.
Could you show some potential usage, logically, how this feature will be used, if it is implemented?
@wmjordan Sorry for the late response, but I would like to revisit this feature proposal. I think it would be quite useful.
As @wmjordan demonstrated here, it is possible to implement this feature. We have also briefly discussed potential behavior(s) of this feature, but not very rigorously. I will describe how this feature could be implemented, potential usages, advantages/disadvantages, etc.
Enhanced Syntax Highlighting
For clarity, this feature will be referred to as ESH (Enhanced Syntax Highlighting).
Scope
This describes how ESH would apply to certain language constructs, tokens, and other elements.
I propose #1
and/or #2
.
1. Default Codist Syntax Highlighting
ESH would use the default Codist syntax highlighting engine (seen here?) and behave like other forms of syntax highlighting.
2. Type-specific Syntax Highlighting
ESH would only apply to specific types, such as DateTime
. As @wmjordan described here, this would adversely affect performance. Furthermore, @fitdev (per his response) and I wouldn't be too interested in this hyper-specific level of customization.
3. Token-specific Syntax Highlighting
ESH would only apply to user-defined tokens; e.g., a variable name. This could raise the issue of maintaining a handle on the applied tokens, an issue similar to the one we discussed in #231.
4. Regex-specific Syntax Highlighting
ESH would apply to tokens matching a regex filter, as we have previously hypothesized. However, this is likely far too costly for performance.
Use-case
ESH could be used to improve readability and disambiguate language constructs. Here are some examples:
Example 1
Suppose a user wants to customize keyword
tokens, however there are different subtypes of keyword
tokens. However, the user doesn't want to customize other syntax elements because: 1), he wants to preserve unique customizations for use with other elements; and/or 2), he can't change the other elements of syntax customization due to precedence or other overrides.
Example ESH Configuration GUI
Current GUI:
Hypothetical ESH view:
Note: this GUI mockup doesn't include options for positioning the glyph
from codist.
Any thoughts @wmjordan @fitdev?
from codist.
Seems reasonable. Ability to control placement (position) would be nice though.
from codist.
I have little idea about what to display on top of those "highlighted" elements.
I tried to implement a demo and found that there were too many decorations which distracted me.
from codist.
Related Issues (20)
- Bug: Super Quick Info 疊加顯示沒有底色 HOT 1
- Broken syntax highlighting with latest Codist and VS 17.9.0 Preview 1.1 HOT 4
- 有计划推出Jetbrains Rider版的Codist嘛? HOT 1
- Codist Beta 7.8 HOT 38
- Quick info does not show uo. HOT 4
- [Feature request] Ability to 'export' colors to the VS color settings HOT 3
- The outer class of a nested class is missing from Quick Info HOT 1
- 在查看Resharper反编译的代码时,有可能会抛出异常IndexOutOfRangeException HOT 5
- Codist 7.9 beta HOT 32
- Feature Request: Add Ability To Search Properties For Windforms HOT 1
- 主题共享 HOT 1
- Add support for changing Inline Hits HOT 8
- 方向键失效 HOT 2
- 小问题:为什么 IDisposable 接口图标是带警告的⚠️ HOT 7
- Syntax highlight colors are becoming too dark HOT 8
- Super Quick Info中文XML注释有锯齿 HOT 2
- Suggestion: Search for Optional Method Parameter Usage HOT 24
- [Feature] Quick Info 给 xml <code><example> 代码提供语法着色和外框 HOT 1
- XmlDoc Custom Link Text Not Working For cref in see and seealso HOT 3
- Suggestion: Support Comment Tagger in web-related files: razor, cshtml, js, css HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codist.