atom / language-python

Python package for Atom
Other
191 stars 147 forks source link

Scope built in functions as support.function #287

Closed Ben3eeE closed 5 years ago

Ben3eeE commented 5 years ago

Requirements

Description of the Change

Scopes built in python functions as support.function. Textmate scoped these as support.function.builtin.python.

https://github.com/atom/language-python/issues/286 reported that print is no longer scoped as keyword.other. Textmate always scoped print and exec as keyword.other even when they were used as a function. In Python 3 these keywords were removed and print and exec are built in functions.

This PR fixes https://github.com/atom/language-python/issues/286 by scoping all built in functions as support.function.

Function list taken from https://docs.python.org/3/library/functions.html

Alternate Designs

Benefits

Applicable Issues

Fixes https://github.com/atom/language-python/issues/286

/cc: @maxbrunsfeld

maxbrunsfeld commented 5 years ago

Do the newlines in the regex affect anything?

Ben3eeE commented 5 years ago

Yeah, it makes the names around newlines not work :bear:

winstliu commented 5 years ago

What about multiline ''' strings?

Ben3eeE commented 5 years ago

Couldn't get multiline strings to work.

maxbrunsfeld commented 5 years ago

What about multiline ''' strings?

I think that syntax will remove the leading whitespace from each line of the string, but there will still be a newline in there.