Comments (7)
one more instance I know of is $a:b
. There are a few well-known prefixes like $private:
, $script:
, $global:
, but this syntax applies to more scenarios beyond, such as
$function:SayHello = {"Hello"}
SayHello
> Hello
$f:myfile = "content for my file"
$f:myfile
> content for my file
cat F:\myfile
> content for my file
$f:myfile:alternateDataStream = "hidden content"
$f:myfile:alternateDataStream
> hidden content
cat F:\myfile:alternateDataStream
> hidden content
from editorsyntax.
You can look at the tokenizer code to see what characters are valid. Basically almost anything and if you use a brace, pretty much anything (including whitespace) until a closing brace.
from editorsyntax.
Is there a list of special characters that don't require ${ }
anywhere? Ie, $Foo*bar
is allowed but you need to use ${Foo*bar}
. I assume it's every special character that isn't an operator or keyword but I could be wrong.
from editorsyntax.
Hmm I think @JamesWTruher, @daxian-dbw, or @SteveL-MSFT might know the answer to that.
from editorsyntax.
Thanks @SteveL-MSFT.
Will need to give some thought to the best way to tackle variables. With so many ways to PowerShell a cat I want to cover all of the variable variants in as concise a manner as possible. The current definitions are not great.
@daxian-dbw, part of me hates that those are real... part of me thinks that's super cool lol.
from editorsyntax.
@omniomi It seems that the main set of characters is [A-z0-9_?:]. However, if it's a colon followed by another colon, it's a static member and not part of the variable name like $a::b. And if a brace follows the $
, then anything until the closing brace is part of the variable name.
from editorsyntax.
@SteveL-MSFT that works and should probably cover most cases.
I just need to figure out the best way to split everything in the repository so that it can be logically included in other places. How things are highlighted on their own, in strings, in sub-expressions, etc adds to the complexity. Can't just have one variable definition and use it everywhere. Splatting adds to complexity as well since Get-Something @Splat
is a variable but $ByLine = "Author: @omniomi"
is not.
from editorsyntax.
Related Issues (20)
- its possible to implement empty coallesing operator HOT 3
- Comment Based Help Keywords and Their Parameters Not Highlighting Correctly HOT 2
- FTLOG Don't use light gray on a white background
- Powershell syntax highlighting disrupted by single quotes in HTML
- Function without arguments not colorized HOT 2
- foreach not scoped correctly after curly brace
- Asterisk is not recognized as valid function/cmdlet name character HOT 1
- Export-Member color coding issue
- Parameters are shown using variables-color HOT 7
- Version v2021.5.1 Semantic Textmate Scope is incorrect for negative numeric literals, when used as a parameter HOT 4
- No Syntax Highlighting for `enum` declarations HOT 2
- #Requires syntax highlighting bug HOT 2
- Syntax Highlighting doesn't recognize ? as part of a variable name
- Generic method type parameter support
- Syntax Highlighting: region incorrectly highlighted when defined as part of a hashtable
- Function name not recognized in definition when on different line
- word_wrap settings does not obey the global settings in sublime text HOT 1
- Attributes not attached to parameters aren't recognized as attributes but as a generic type
- Code thinks ArgumentCompleter attribute on parameter is the parameter's type
- Variables that are built-in constants are not highlighted, like `$Error` and `$PSVersionTable`
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 editorsyntax.