-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Add syntax highlighting for JavaScript string methods #16616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dotnet] Add syntax highlighting for JavaScript string methods #16616
Conversation
|
Thank you, @RenderMichael for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
I am 50/50. From one point of view it is nice feature for end users. From another hand it is expensive to support "old" users (net462, netstandard2.0). We are trying to bring good compiler/tools features even if "old" users are unintended to support it. Hacks like defining missing attributes in our codebase. I remember how we introduced nullability and NRT - magic unnecessary internal code for analyzer/compiler. I would support this proposal only for modern users (net8+). |
|
Good point, keeping one extra internal class is better than |

User description
This will allow JavaScript syntax highlighting for users that do something like:
Visual Studio does not have great support for this, but Rider does (works the same as its language injection).
PR Type
Enhancement
Description
Add
[StringSyntax("javascript")]attribute to JavaScript string parametersEnable IDE syntax highlighting for JavaScript code in string parameters
Create polyfill
StringSyntaxAttributefor .NET versions before 8.0Apply attribute across multiple JavaScript execution methods and interfaces
Diagram Walkthrough
File Walkthrough
13 files
Create StringSyntaxAttribute polyfill for older .NET versionsCreate StringSyntaxAttribute polyfill for older .NET versionsAdd StringSyntax attribute to ExecuteScript methodsAdd StringSyntax attribute to script parameterAdd StringSyntax attribute to ExecuteJavaScript extension methodsAdd StringSyntax attribute to JavaScript evaluation methodsAdd StringSyntax attribute to interface method signaturesAdd StringSyntax attribute to interface method signaturesAdd StringSyntax attribute to ScriptSource propertySimplify StringSyntax attribute usage with polyfillAdd StringSyntax attribute to AddInitializationScript and PinScriptAdd StringSyntax attribute to Source propertyAdd StringSyntax attribute to ExecuteScript methods