Coder Social home page Coder Social logo

Comments (6)

kaste avatar kaste commented on July 20, 2024

I never intended to make these persistent. Actually a user in one of the issues brought this to my attention, and I liked the idea a lot.

I personally disbale/enable via Package Control if I want persistence (for which this addon provides a hook so I don't have to restart Sublime in between). If I use the other toggles I actually like it that they reset if I restart Sublime. So, basically speaking, I have my base configuration set in stone, and then I change it during runtime with the commands here, but I really like it that they don't mess up my original configuration.

Since this is an addon, this is not meant to be the final solution. It is maybe even less code to make a persistent solution.

	s = sublime.load_settings('SublimeLinter.sublime-settings')
	s.setdefault('linters', {}).setdefault(<linter_name>, {})['disable'] = True|False
	s.save_settings('SublimeLinter.sublime-settings')

That's basically all you need to do.

from sublimelinter-addon-toggler.

brupelo avatar brupelo commented on July 20, 2024

@kaste Ok, thanks. I've ended up tweaking the package so now will persist the commands. Thing is, I've been using v3.8.0 for many months and today accidentaly I've removed it, after that was pretty difficult to restore back that old version so I've decided to give it a shot to the latest master, it still feels pretty weird as a lot of nice stuff is gone... Hopefully I'll get used to it, but still... feels weird.

Anyway, ty.

from sublimelinter-addon-toggler.

brupelo avatar brupelo commented on July 20, 2024

One last question, even if "disabled" I can still see SublimeLinter is spawned behind the curtains, is there any easy way to fully enable/disable it? And if not, would it be possible to make the background process "lighter" when disabled?

Thx.

from sublimelinter-addon-toggler.

kaste avatar kaste commented on July 20, 2024

These questions are too broad and vague. I don't know what spawned and lighter should mean.

from sublimelinter-addon-toggler.

brupelo avatar brupelo commented on July 20, 2024

@kaste Yeah, you're absolutely right, my previous comment was vague indeed, ok, let me try again, consider we're on "Save" mode with "Debug" enabled, now, let's test sublime-flake8-linter on a foo.py file, check here.

So, in that video I've typed few characters "a=1+2\nb=3+4" and then pressed "Save", from my User point of view, I'd like to think SublimeLinter has made only the necessary work but... if we take a look to the console debug output we will see a fair ammount of output:

SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: linter.py:887: Checking lint mode save vs lint reason None
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: linter.py:887: Checking lint mode save vs lint reason None
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: linter.py:887: Checking lint mode save vs lint reason None
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: linter.py:887: Checking lint mode save vs lint reason None
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.34s
SublimeLinter: sublime_linter.py:250: Delay buffer 66 for 0.0s
SublimeLinter: linter.py:887: Checking lint mode save vs lint reason on_save
SublimeLinter: #7 linter.py:907: 'flake8' is linting 'foo.py'
SublimeLinter: #7 python_linter.py:42: flake8: wanted python is 'None'
SublimeLinter: #7 python_linter.py:93: flake8: trying to use globally installed flake8
SublimeLinter: #7 linter.py:1263: Running ...

  D:\sources\personal\python\apps\pyqt\whatever  (working dir)
  > type foo.py | d:\virtual_envs\py364_32\Scripts\flake8.exe --format default --config=D:\sources\personal\sublimetext3\Data\Packages\User\.flake8 -

SublimeLinter: #7 linter.py:955: flake8 output:
    stdin:1:2: E225 missing whitespace around operator
    stdin:1:4: E226 missing whitespace around arithmetic operator
    stdin:2:2: E225 missing whitespace around operator
    stdin:2:4: E226 missing whitespace around arithmetic operator
SublimeLinter: sublime_linter.py:444: Linting buffer 66 took 0.78s

So, in this context "lighter" means on Save mode SublimeLinter is doing job that should only be made on background mode and "spawned" means all these fired events each time you're typing.

I mean, don't get me wrong, so far SublimeLinter isn't slowing me down (although I don't tend to have more than 20python files at the same time on a project... But, the fact SublimeLinter seems to do stuff that seems to be "background" job bothers me...

Anyway, thought was worth mentioning/asking, not polluting more thisd close thread which was already solved.

Ty.

from sublimelinter-addon-toggler.

kaste avatar kaste commented on July 20, 2024

That's just logging noise. What you're seeing here takes less than 1ms. Note, that the logging itself is really expensive, so you should turn that off.

from sublimelinter-addon-toggler.

Related Issues (2)

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.