Git Product home page Git Product logo

Comments (6)

nfnty avatar nfnty commented on July 26, 2024 2

This has been fixed over at the fork vim-python/python-syntax.

from python-syntax.

Aluriak avatar Aluriak commented on July 26, 2024

This module implements the self and cls highlighting, which is a good feature.
Plus, it can be deactivated using a dedicated option.

Maybe you will found a compromise here.

self is actually just a conventional name for the first argument of a method. And if somebody uses for example just s instead it won't be highlighted and just will be confusing.

Precisely because its conventionnal (and a convention widely accepted), allowing it to be highlighted is a good feature. From experience, it's very appreciable.
Using s leads to confusing code, more than any highlighting.

But that's probably involve actually parsing file or something and is harder (or impossible) to do with regexp.

I think its impossible in vim. Needs a static code checker. Jedi could help, but it seems to be a little over-engineered.

from python-syntax.

sscherfke avatar sscherfke commented on July 26, 2024

python-mode also highlights self/cls and maps it to the highlight group pythonSelf. You could make it optional via a config variable.

from python-syntax.

purpleP avatar purpleP commented on July 26, 2024

@sscherfke I don't use python mode, because I don't like its take it all or leave it approach. I think that that it should be the set of instructions or a script or something else, but not the bunch of packages, that you can't remove if you don't need them.
If anyone interested in highlighting self, cls, default arguments and other improvements check out my fork of this project.

from python-syntax.

sscherfke avatar sscherfke commented on July 26, 2024

@purpleP Curretnly moving away from python-mode and missing the highlighted selfand cls … ;-)

from python-syntax.

purpleP avatar purpleP commented on July 26, 2024

@sscherfke by the way, for easy access here is the link to my fork

from python-syntax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.