-
Notifications
You must be signed in to change notification settings - Fork 46
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
WIP a preview of what I have been working on #155
base: main
Are you sure you want to change the base?
Conversation
Mass update
Just to check. Is it "Before -> After" or "After -> Before" in your images? |
lots of good stuff :) |
Sorry, forgot that detail. Due to my existing window placement, its 'After <- Before' … kind of backwards, and I totally missed that someone probably would have trouble making that out. |
Some examples from the commit that will be coming:
|
While working with the above (lower) test file, I noticed I was scoping Also note, at microsoft/vscode-textmate#82, is an issue that might affect what I have done here in some places, where I have relied on VS Code's behavior of A better example difference in some typical code: (old on top, this PR on bottom, same custom theme) |
It's going to take me a while to review everything here and comment directly but a couple things just quickly:
What makes for a legal variable name changes inside strings, outside strings, inside sub-expressions, and using the Effectively you would need to move the sub-expression logic into the variable definitions and do some sort of "am I in a string" checking which would need to be more than just looking for the quotes as it would need to account for I have been playing with redoing the variables for a quite a while and I still don't know what the best course of action is tbh.
Please be sure to read #138 There is substantial debate on what responsibility the syntax has toward accuracy vs. expectation. It also shouldn't be assumed that any other language is correct which raises the question do we aim for consistency with incorrect languages or aim for being "correct" in our own right and encourage other syntax projects to catch up? Further, while PowerShell is related to C# it is also perl-like in a number of ways so there is value comparing certain elements to Perl highlighting and PHP highlighting. If sigils ( ... Thanks for submitting this PR, it's great to see a bunch of your work and ideas in one place. Will review as I have time. |
Sorry, what I meant, is that this PR demonstrates an optimized approach (but only barely) where the decoding of the scopes of variables is handled in 1 spot, currently as a 'capture with patterns' (using a single regex to capture the entire variable name), and I resolved the logic behind members or not members with the original 'variable' vs 'variableNoProperty'. So now, the logic to scope No worries about time. I know I still have some things I want to accomplish. Having said what I have above, I now know that variable names can span multiple lines once the I also plan to keep researching using a 'statement mode tokenizing process', for both PowerShell and Windows Batch. This would allow for a highlighting more consistent with the actual interpreter, the goal being a bit more accuracy and richness. (reference #153 (comment)) (Now demonstrated in PR #156) My goal within this PR has been on the side of accuracy and richness, and it has been fairly achievable, but I have worked with languages that TextMate syntax could not achieve the level of accuracy (and thus the richness) I would have liked. |
Just by chance: Any news on this PR? |
@SetTrend, no news. Is there anything in particular that this PR is of interest? Have you looked at PR #156? This PR does contain some work towards In the long run, I think #156 is a better syntaxing solution. It can give the correct scoping while handling the extreme flexibility that PowerShell offers . |
The only thing I wait for is no "WIP" in the PR title and passing CI |
As was told to me early on, touching one thing breaks or discovers another, so its been difficult to find a stopping point.
This PR is meant to make it easy to see what I have been doing, and provide feedback, but its not necessarily intended to be an implemented PR.