-
Notifications
You must be signed in to change notification settings - Fork 16
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
Library functions are not identified by Scope selectors #108
Comments
I'm not sure what you are exactly referring to by scope selector. It sounds like you're referring to namespaces, eg. that |
I mean that both sides of the function name should respond to same syntax scope e.g. "entity.library-function.powerquery". Now only the left side of "." is identified by syntax and right side has none at all. |
No actions planned on the issue? |
I'm trying to understand the exact issue being raised. Is it that the powerquery.tmLanguage.json is incorrect in that it's splitting tokens on the periods, eg. |
Absolutely! And there can be 2 types of mistakes either it's pattern/capture structure or regex of the definition. I suspect first though. |
(([A-Z][A-Za-z0-9_]+)(?=(.)).(\w*\b)) For example a simple regex like this one will catch both sides of Left.Right statements and nothing more... |
Oh. C'mon aren't there someone who can adjust a tmLanguage.json file so all the scopes are included properly? |
@necroze I've been pulled in a few directions of late where I haven't had time to verify that your suggestion works as expected. If you are interested the repository is open source and you can submit a PR which I'll try to make time to verify. |
@JordanBoltonMN I am really interested in repo but right now I got an all out war in my country. Thus I am distracted from the matter. I hope we will be able to get back to it in the future, when it’s safe again. |
I hope you're safe. I felt like replying since there hasn't been an update. The short answer: It's not likely to go into main because there's no classes in Power Query.
You can see exactly what characters (codepoints) are valid, if you go down the grammar tree Some Textmate Customization in your profileFor your screenshot did you modify your "editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment.line", // single-line comments
"settings": {
"foreground": "#6ea58049",
"fontStyle": "bold"
} } ] } Local overrideThe easiest method might be to edit your local grammar file. To find the latest Pwsh> (ls "$Env:USERPROFILE/.vscode/extensions/*powerquery*/syntaxes/powerquery.tmLanguage.json" | sort LastWriteTime)[-1].FullName Mine is Stress Testing + Semantic highlightI was curious so I made a stress test, your regex works surprisingly well. Note: I switched the dialect to dotnet while experimenting, so I could use There's some sort of fallbacks to TM when using semantic highlighting, if that were enabled, maybe you can force certain tokens to fallback to textmate, to colorize it like a class. Then you could hook into one specific token type -- making your regex simplerm and more accurate |
Hello,
in the syntax definition of powerquery - scope selector for library functions is absent.
Parts of a function(List.Generate for example)
"List" part shows "entity.name" scope
".Generate" part shows "no scope selector"
There are numerous ways to fix that - from hardcoding function names ending to adding a proper regex into syntax file.
Please do something. It is important for me and lots of other PBI developers(I asked =))
The text was updated successfully, but these errors were encountered: