Code Monkey home page Code Monkey logo

Comments (5)

DamnWidget avatar DamnWidget commented on June 19, 2024

It shouldn't work on files that are not python, it doesn't even work on python strings or comments. The linting method is decorated with this decorator:

def only_python(func):
    """Execute the given function if we are on Python source only
    """

    @functools.wraps(func)
    def wrapper(self, view, *args, **kwargs):

        if is_python(view):
            return func(self, view, *args, **kwargs)

    return wrapper

...

def is_python(view):
    """Determine if the given view location is python code
    """

    location = view.sel()[0].begin()
    matcher = 'source.python - string - comment'

    return view.match_selector(location, matcher)

So it shouldn't try to lint any file that is not Python source. I don't think this should happen. Can you check if closing the file and open it again it lints it?

from anaconda.

bryan-lott avatar bryan-lott commented on June 19, 2024

Closing and re-opening the file doesn't lint it. However, then restarting ST3 will fire the linter again.

I tried to get the linter to only work on python files by setting the anaconda_linting to false in user settings, then in python settings setting it back to true but anaconda seems to ignore the setting in user settings somehow? (I've tried putting the anaconda_linting: false in both the "main" user settings and the anaconda user settings).

In case it matters (can't see why it would), I have python 2.7 as my installed python, am using ST3's latest dev build (3052), and am running windows 7 x64.

from anaconda.

jarhart avatar jarhart commented on June 19, 2024

This is happening for me as well, for any type of file, but only when Sublime is first started, and only for the current view. Once I close that file everything is fine.

It's easy to reproduce:

  1. Open a non-python file in Sublime.
  2. Quit Sublime
  3. Start Sublime

Sublime Text Build 3047, OS X 10.8.4

from anaconda.

DamnWidget avatar DamnWidget commented on June 19, 2024

Thats because the linting request is fired by a Python view but when the remote method is called on the server the actual view from the actual window has been replaced with a non-python buffer.

It will be eventually fixed.

from anaconda.

DamnWidget avatar DamnWidget commented on June 19, 2024

Hi @andrewning

I'm workin in #13 right now but this is the next on the list.

from anaconda.

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.