tokenizer treats commands as expandable strings
See original GitHub issueThe tokenizer seems to treat commands (and some other tokens) as expandable strings. Why is this? It makes misleading colorization in PSReadLine.
function crazy$function {echo test} # `$function` appears to be a variable, but is not
crazy$function # again, `$function` appears to be a variable that will expand, but it is not
Another one that occurs is if you start a command with a dash, the tokenizer marks it as a parameter, but it should mark it as a command.
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
Tokenizers | Apache Solr Reference Guide 6.6
This tokenizer creates tokens from strings of contiguous letters, discarding all non-letter characters. Factory class: solr.LetterTokenizerFactory. Arguments: ...
Read more >Tokenizer
Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special tokens and clean up tokenization...
Read more >NLTK Tokenize: Words and Sentences Tokenizer with ...
These tokens are very useful for finding patterns and are considered as a base step for stemming and lemmatization. Tokenization also helps to ......
Read more >Unleashing the ChatGPT Tokenizer
What is happening here is that the tokenizer actually breaks the given word down into three tokens: “l” ,“oll” and “ipop”. Therefore, ChatGPT ......
Read more >about Parsing - PowerShell
Argument mode is designed for parsing arguments and parameters for commands in a shell environment. All input is treated as an expandable string...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
By design, a command name can contain any characters that can be in a file name since, rather obviously, files are commands. And, since it’s also perfectly valid to have a file
foo$bar.ps1
, such names must be supported as commands. So functionally, everything is fine and cannot change. But it would be nice to fix the highlighting . The token is correct in the AST. Can you not use that?@msftrncs I think @iSazonov means that having a function name like
foo$bar
is an edge-case.