Packages: [Python] meta.function-call.python scope no longer applied inside function calls

Created on 8 Dec 2018  路  3Comments  路  Source: sublimehq/Packages

Env

OSX 10.12.6, ST 3184.

Description

The meta.function-call.python scope is no longer being applied inside Python function calls. It's applied outside the function, but inside only the meta.function-call.arguments.python scope is applied.

From what I understand, ST's Python syntax is based on MagicPython, which applies meta.function-call-python to all of the function call, including its args.

In any case, this is probably a regression. I have a package, Requester, which depends on the application of meta.function-call.python to all of the function call for some of its functionality, and this change caused part of the package to break.

This may have been introduced in 3181, which added some improvements to syntax highlighting for various languages.

Here's a screenshot showing the problem.

screen shot 2018-12-07 at 5 13 43 pm

Most helpful comment

I confess I do not know much about plugin architecture, but could you not change the selector you look for to be source.python meta.function-call rather than meta.function-call.python?

All 3 comments

@FichteFoll

I found the commit, 60e1b60, that stopped meta.function-call.python from being applied to the entire function call.

If I revert the Python syntax file to its state before this commit, meta.function-call.python is applied correctly.

I don't know enough about syntax highlighting to submit a PR, but I figure the fix is relatively simple because we know which commit caused the problem.

Here's a screenshot showing how it used to work.

screen shot 2018-12-07 at 9 43 25 pm

I confess I do not know much about plugin architecture, but could you not change the selector you look for to be source.python meta.function-call rather than meta.function-call.python?

@michaelblyons

Regardless of what you know about plugin architecture, you definitely know a lot more than I do about syntax definitions!

That fixed the problem, and you taught me two things: you can target multiple scopes with a selector, and you can target the prefix of a scope without having to match all of it.

Thanks a bunch! I'll close this.

@FichteFoll

Sorry for the false alarm!

Was this page helpful?
0 / 5 - 0 ratings