Comments (3)
Thanks for the report.
The issue here is that the grammar for php is non-discriminatory for regular expressions. If at any time it sees a string with /
delimiters, it just assumes you're wanting to do a regex operation and the scope switches entirely.
The reason that Cobalt2 isn't affected is because they likely don't scope regular expressions at all. That's not an ideal solution here because in languages that have deep regular expression grammar baked in (e.g. javascript and typescript), the highlighting of the different groups really comes in handy.
The reason why some other themes are affected, but where the string is entirely a different color than what strings are normally supposed to be is because they likely scope regular expressions, but don't scope it down any further.
This theme has unique highlighting for every scope within a regular expression, which is why you're seeing red delimiters and yellow string-literals. Here's an example of that in typescript:
TL;DR: The fix would have to be made in the grammar. It cannot be made in the theme. Would you mind opening this issue here instead?
Thanks in advance!
from visual-studio-code.
Gotcha. I did figure it might be something out of your control, since it was hit and miss. Sorry.
Happy to post the issue elsewhere so this can be tackled. Only thing is the link you gave me is for Atom -> PHP. Can you confirm where best to post for VS Code PHP issues?
from visual-studio-code.
Oh, just realized you also were wondering why the first parsed as a normal string and the second did not..
That's because the first uses the delimiter character inside the "expression", so the regex scope match fails and it defaults back to string.
The second one has the delimiter character only on the outer edges of the string, so the regex scope passes.
More examples....
<?php
$not_regex_1 = '/some-dirname';
$not_regex_2 = 'some-other-dirname/';
$regex = '/i-am-now-regex/';
Gotcha. I did figure it might be something out of your control, since it was hit and miss. Sorry
No apology necessary! I'd prefer things like this to be reported and clarified, rather than not.
Only thing is the link you gave me is for Atom -> PHP. Can you confirm where best to post for VS Code PHP issues?
Yep, that's the right location. VSCode pulls the PHP grammar directly from Atom.
from visual-studio-code.
Related Issues (20)
- Extension removed from marketplace? HOT 1
- Extension missing HOT 1
- Horizontal separator does not match theme background color
- Unclear active tab HOT 1
- Color Change in Git Diff mode HOT 5
- F-String and # wrong colouring brackets
- Syntax Highlighting not working properly for JS/TS HOT 19
- Add V Programming Language Support
- report bug for go language when use parameter of function color not match HOT 3
- Installation issue in VScode HOT 5
- so many points in vscode
- Ruby - hash Keys & named parameter values color issue HOT 1
- Different color than comments for docstrings in python HOT 2
- Some kind of indication of currently selected item HOT 1
- Is there any problem with the latest color scheme HOT 20
- I need the 'Dracula Soft' theme, and I hope it won't be removed. HOT 17
- Workbench tree indent guidelines invisible in v2.25.0 HOT 2
- Does Dracula Pro include the old `Dracula` theme? HOT 5
- Highlighted text in UI elements is not visible HOT 3
- High Contrast Issue with “Select Interpreter” Button in Dracula Pro 2.0 (theme 1.1.0) HOT 1
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 visual-studio-code.