Coder Social home page Coder Social logo

julianeberius / sublimepythonide Goto Github PK

View Code? Open in Web Editor NEW
267.0 267.0 38.0 764 KB

ST3 only: A rewrite of SublimeRope for ST3, uses the Rope library to add python completions and refactoring to ST3

License: GNU General Public License v2.0

Python 99.78% JavaScript 0.22%

sublimepythonide's People

Contributors

akostyuk avatar asfaltboy avatar barbak avatar berndtbrkt avatar damnwidget avatar delicb avatar derekleverenz avatar julianeberius avatar larsxschneider avatar marciomazza avatar martinmaillard avatar meshy avatar miohtama avatar navilan avatar northisup avatar oscarl avatar szhu avatar xhacker avatar xiaochuanyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublimepythonide's Issues

how on earth do you develop for this?

Mainly I am interested in being able to run the server external to sublime in a debug mode. Is there existing support for this in config or should I add it?

Add command to temporarily disable pep8

Is there a way to disable pep8 on the fly right now without manually editing preferences?
This would be a nice to have for browsing old files that may not comply with PEP8.

# noqa style ignores for linter

It would be great if we could customize SPIDE to ignore linter errors on lines, or per module, if it detects comments matching a certain regex.

For example, flake8 will ignore modules having # flake8: noqa in the module, or a line having # noqa on it.

Does anything like this currently exist in SPIDE?

SublimeText3 Freezes after update

SublimePythonIDE used to give no issues. After what appeared to be an update, it now hangs after half an hour until ps ax |grep plugin_host | awk '{print $1}' | xargs kill -9 is executed.

Traceback (most recent call last): File "/Users/bjolit/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python.py", line 170, in send_heartbeat self.proxy.heartbeat() File "X/xmlrpc/client.py", line 1090, in __call__ File "X/xmlrpc/client.py", line 1419, in __request File "X/xmlrpc/client.py", line 1132, in request File "X/xmlrpc/client.py", line 1143, in single_request File "X/xmlrpc/client.py", line 1248, in send_request File "X/http/client.py", line 932, in putrequest http.client.CannotSendRequest: Request-sent

[WinXP] No server respose for unsaved buffers.

Using the latest version, on Windows XP.

When trying to test the autocomplete functionality, I get (using SERVER_DEBUGGING = True):

started server on port 2161 with C:\Python27\python.exe IN DEBUG MODE
SublimePythonIDE: No server respose
'NoneType' object has no attribute 'data'
started server on port 2163 with C:\Python27\python.exe IN DEBUG MODE

Server on port 2163 - STDERR: b'SublimePythonIDE Server is starting in Debug mode\r\n'
Server on port 2163 - STDERR: b'SublimePythonIDE Server is called: completions\r\n'
Server on port 2163 - STDERR: b'Traceback (most recent call last):\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\server.py", line 134, in completions\r\n'
Server on port 2163 - STDERR: b'    project, source, loc, resource=resource, maxfixes=3)\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 33, in code_assist\r\n'
Server on port 2163 - STDERR: b'    return assist()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 335, in __call__\r\n'
Server on port 2163 - STDERR: b'    completions = list(self._code_completions().values())\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 403, in _code_completions\r\n'
Server on port 2163 - STDERR: b'    pymodule = fixer.get_pymodule()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\utils.py", line 10, in _wrapper\r\n'
Server on port 2163 - STDERR: b'    setattr(self, name, func(self, *args, **kwds))\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\fixsyntax.py", line 24, in get_pymodule\r\n'
Server on port 2163 - STDERR: b'    self.resource.read() == code:\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 81, in read\r\n'
Server on port 2163 - STDERR: b'    data = self.read_bytes()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 88, in read_bytes\r\n'
Server on port 2163 - STDERR: b"    return open(self.real_path, 'rb').read()\r\n"
Server on port 2163 - STDERR: b"IOError: [Errno 13] Permission denied: 'c:\\\\docume~1\\\\oscarl\\\\config~1\\\\temp\\\\tmpmt7hm7'\r\n"

Server on port 2163 - STDERR: b'SublimePythonIDE Server is called: completions\r\n'
Server on port 2163 - STDERR: b'Traceback (most recent call last):\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\server.py", line 134, in completions\r\n'
Server on port 2163 - STDERR: b'    project, source, loc, resource=resource, maxfixes=3)\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 33, in code_assist\r\n'
Server on port 2163 - STDERR: b'    return assist()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 335, in __call__\r\n'
Server on port 2163 - STDERR: b'    completions = list(self._code_completions().values())\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 403, in _code_completions\r\n'
Server on port 2163 - STDERR: b'    pymodule = fixer.get_pymodule()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\utils.py", line 10, in _wrapper\r\n'
Server on port 2163 - STDERR: b'    setattr(self, name, func(self, *args, **kwds))\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\fixsyntax.py", line 24, in get_pymodule\r\n'
Server on port 2163 - STDERR: b'    self.resource.read() == code:\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 81, in read\r\n'
Server on port 2163 - STDERR: b'    data = self.read_bytes()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 88, in read_bytes\r\n'
Server on port 2163 - STDERR: b"    return open(self.real_path, 'rb').read()\r\n"
Server on port 2163 - STDERR: b"IOError: [Errno 13] Permission denied: 'c:\\\\docume~1\\\\oscarl\\\\config~1\\\\temp\\\\tmpl3lr50'\r\n"

Server on port 2163 - STDERR: b'SublimePythonIDE Server is called: completions\r\n'
Server on port 2163 - STDERR: b'Traceback (most recent call last):\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\server.py", line 134, in completions\r\n'
Server on port 2163 - STDERR: b'    project, source, loc, resource=resource, maxfixes=3)\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 33, in code_assist\r\n'
Server on port 2163 - STDERR: b'    return assist()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 335, in __call__\r\n'
Server on port 2163 - STDERR: b'    completions = list(self._code_completions().values())\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 403, in _code_completions\r\n'
Server on port 2163 - STDERR: b'    pymodule = fixer.get_pymodule()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\utils.py", line 10, in _wrapper\r\n'
Server on port 2163 - STDERR: b'    setattr(self, name, func(self, *args, **kwds))\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\fixsyntax.py", line 24, in get_pymodule\r\n'
Server on port 2163 - STDERR: b'    self.resource.read() == code:\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 81, in read\r\n'
Server on port 2163 - STDERR: b'    data = self.read_bytes()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 88, in read_bytes\r\n'
Server on port 2163 - STDERR: b"    return open(self.real_path, 'rb').read()\r\n"
Server on port 2163 - STDERR: b"IOError: [Errno 13] Permission denied: 'c:\\\\docume~1\\\\oscarl\\\\config~1\\\\temp\\\\tmptin9y5'\r\n"

Server on port 2163 - STDERR: b'SublimePythonIDE Server is called: completions\r\n'
Server on port 2163 - STDERR: b'Traceback (most recent call last):\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\server.py", line 134, in completions\r\n'
Server on port 2163 - STDERR: b'    project, source, loc, resource=resource, maxfixes=3)\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 33, in code_assist\r\n'
Server on port 2163 - STDERR: b'    return assist()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 335, in __call__\r\n'
Server on port 2163 - STDERR: b'    completions = list(self._code_completions().values())\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 403, in _code_completions\r\n'
Server on port 2163 - STDERR: b'    pymodule = fixer.get_pymodule()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\utils.py", line 10, in _wrapper\r\n'
Server on port 2163 - STDERR: b'    setattr(self, name, func(self, *args, **kwds))\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\fixsyntax.py", line 24, in get_pymodule\r\n'
Server on port 2163 - STDERR: b'    self.resource.read() == code:\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 81, in read\r\n'
Server on port 2163 - STDERR: b'    data = self.read_bytes()\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\base\\resources.py", line 88, in read_bytes\r\n'
Server on port 2163 - STDERR: b"    return open(self.real_path, 'rb').read()\r\n"
Server on port 2163 - STDERR: b"IOError: [Errno 13] Permission denied: 'c:\\\\docume~1\\\\oscarl\\\\config~1\\\\temp\\\\tmpqzas3p'\r\n"

Server on port 2163 - STDERR: b'SublimePythonIDE Server is called: completions\r\n'
Server on port 2163 - STDERR: b'Traceback (most recent call last):\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\server.py", line 134, in completions\r\n'
Server on port 2163 - STDERR: b'    project, source, loc, resource=resource, maxfixes=3)\r\n'
Server on port 2163 - STDERR: b'  File "C:\\Sublime Text Build 3047\\Data\\Packages\\SublimePythonIDE\\server\\..\\lib\\python2\\rope\\contrib\\codeassist.py", line 33, in code_assist\r\n'
Server on port 2163 - STDERR: b'    return assist()\r\n'

I have managed to make it work by changing line number 90 of server.py, from this:

    tmpfile = tempfile.NamedTemporaryFile()

to this:

    tmpfile = tempfile.NamedTemporaryFile(delete=False)

(this was the default behavior in SublimeRope)

That means that the server won't automatically remove the temp files when shutting down (they keep pilling up on the user's %temp% folder), but at least works ok.

Maybe we should use delete=False if os.name == 'nt'?

Use default virtualenv based on project path

It'd be nice if you could configure the system to assume you have a virtualenv that matches $WORKHOME/$(basename )

e.g. my workflow was always "subl " to open it rather than configuring a bunch of project-specific (read: annoying IDE) cruft, saving that, and transporting it around.

If that's too far fetched, than at the very least looking for a virtualenv in $WORKON_HOME/<root_dir_in_project> for each directory in the project would be a reasonable default.

False reporting of E126 when tabs are used as indentation.

Hi,

I use tabs in my projects to indent and pep8 linting in SublimePythonIDE reports E126 (over-indented for hanging indent) failing to recognize the tab. To check if that is the case I converted one of the files from tabs to spaces with same indentations and the error message was gone.

The problem seems to be in /lib/pep8.py:expand_indent(line) โ€“ it assumes that tab equivalent of 8 spaces and hence thinks that I over-indented the code.

A couple of very dirty and hacky solutions that I can think of is โ€“ adding a configuration setting for that assumed 8 or maybe getting the tab size from sublime.

Thanks!

Repeat command does not work correctly with identation after paste

Steps to reproduce:

  1. Copy a line (with shift + y)
  2. Paste the line (with p)
  3. Change the identation of any line (with >>)
  4. Try to repeat (with . dot)

Expected: The line would be idented to the left one more time
Result: The line copyed gets pasted again.

I didn't try to much with commands other than identing, but looks like it hapens with other as well - like 'dw', and 'x')

Connection Refused (Win 7 Pro x64)

Receive the below when starting up ST3 (Build 3035). Installed SublimePythonIDE through package control successfully. Response seems to be very slow (after starting to type "import" ST3 seems to freeze for ~10 seconds).

Am on Win 7 Pro x64 w/ Sublime Text 3 Build 3035 x64. Have Python 2.7.4 installed. Please let me know if you need any additional info.

[snip ~20 lines or so of similar output]
starting server on port 62040 with python
starting server on port 62017 with python
starting server on port 62023 with python
starting server on port 62029 with python
starting server on port 62035 with python
[/snip]
Traceback (most recent call last):
File "C:\Users\bryan.lott\AppData\Roaming\Sublime Text 3\Packages\Python IDE\sublime_python.py", line 86, in send_heartbeat
self.proxy.heartbeat()
File "X/xmlrpc/client.py", line 1090, in call
File "X/xmlrpc/client.py", line 1419, in __request
File "X/xmlrpc/client.py", line 1132, in request
File "X/xmlrpc/client.py", line 1143, in single_request
File "X/xmlrpc/client.py", line 1255, in send_request
File "X/xmlrpc/client.py", line 1285, in send_content
File "X/http/client.py", line 1045, in endheaders
File "X/http/client.py", line 890, in _send_output
File "X/http/client.py", line 828, in send
File "X/http/client.py", line 806, in connect
File "X/socket.py", line 424, in create_connection
File "X/socket.py", line 415, in create_connection
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

Blocks SublimeLinter

Once installed, linting seems to be taken over by SublimePythonIDE even though I had a previously installed and used SublimeLinter or this purpose.

Turning lint off in the SublimePythonIDE settings via the flag

{"python_linting": false}

does not re-allow SublimeLinter to work.

This would be all right as both are using the same lint engine, but SublimeLinter has those nice pop-ups I like, and SublimePythonIDE's lint does not!

os: Linux Mint 16
Sublime 3 Build 3059

getting invalid pep8 e712 warning

I'm getting a warning that the following should be using is instead of ==.

rows = data.query(schema.Publish).filter(condish == False)

As far as I understand, pep8 specifies that for if statements only.

freezes on new non-saved files

Create new file using command line:

$ subl newfile.py

It opens in sublime and is non-saved.
Now if you type any letters, sublime freezes for a couple of seconds (looking for autocomplete?).
If you save it (ctrl+s) everything becomes fine.

Disabling SublimePythonIDE package solves the problem. Re-enable it and bug works again.

Sublime Text 3, build 3047 on Linux Mint 14

Project root relative Python path?

I am always using Python from venv virtualenv folder which is in the Sublime project root folder.

Is it possible to have a SublimePythonIDE project setting where Python interpreter is relative to the project root?

// SublimePythonIDE
"settings": {
    "python_interpreter": "relative/path/here/venv/bin/python"
}  

Context Menues

Will you be adding the "Go to documentation" and "Got to declaration" items back into the context menus (right click)?

TypeError: 'NoneType' object is not callable

OS X El Capitan, Python 3.

Enable SublimePythonIDE, in sublime console:

reloading Packages/SublimePythonIDE/SublimePython.sublime-settings
Traceback (most recent call last):
  File "/Users/user_name/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python.py", line 412, in _update_color_scheme
    "warning": get_setting("warning_color"),
TypeError: 'NoneType' object is not callable

Windows: No server respose 'NoneType' object has no attribute 'data'

The error occurs on Windows:

started server on port 54732 with C:\Program Files (x86)\Python\Python34\python.exe
SublimePythonIDE: No server respose
'NoneType' object has no attribute 'data'

The interpreter path is set in SublimePython.sublime-settings:

{
     "python_interpreter": "C:/Program Files (x86)/Python/Python34/python.exe"
}

Python interpreter path detection doesn't work well on non-unix environment

I'm on Windows 10. The detection of fall through/error detection mechanism doesn't work well. Falling through on empty is fine, but IMO it should also fall through on error.

In my case, here's my settings:

  • From SublimePythonIDE settings: None - falls through
  • From venv settings: None - falls through
  • From #! (shebang) line in this file: ['/usr/bin/env', 'python'] - this is the problem
  • From system Python (via $PATH): ['C:\\Python27\\python.exe'] - this value would work, if it was used

There are some work around options, but they seem less than optimal.

If I set C:\\Python27\\python.exe in the project config, everything is okay. However this is, as far as I'm concerned, a system setting for me, and not a project setting.

I have virtual environments set up, using a user-level ~/.virtualenvs directory rather than one under my project's path, though as you can see it is not detecting it. Not sure how to get SublimePythonIDE to find that, or if the path differences would pan out (C:\\Python27\python.exe vs /c/Python27/python.exe).

Edit: I figured out why it isn't detecting my venv. I'm nesting multiple projects under the same source control, with different virtual environments for each, and the venv detection is project folder name based. I can't figure out a reasonable way this could be implemented to work, yet still keep my sublime text project at the root directory. I am guessing a most other projects probably won't have this problem.

Fortunately I have a patch that might make any workarounds unnecessary, and also won't require me to get venv detection working for this project :)

[Bug] More-Python-Completions autocomplete conflict

1. Summary

I see autocompletes of More-Python-Completions package after fifth typing character, not after first character.

2. Expected behavior

I see autocompletes of More-Python-Completions after first character:

First

3. Actual behavior

I see More-Python-Completions autocomplete variants, if I type 5 characters:

Five

4. Steps to reproduce

I reproduce the problem in a version of Sublime Text without plugins and user settings.

I create and open file Example.py and write in it i-array.

If More-Python-Completions enable for me, I get actual behavior.

If More-Python-Completions disable for me, I get expected behavior.

5. Environment

Operating system and version:
Windows 10 Enterprise LTSB 64-bit EN
Sublime Text:
Build 3126
Python:
3.6.0

Thanks.

Does not give suggestions for module paths while importing before the import statement

I develop using django, and incase of any imports I am not getting any suggestions. Let me elaborate:

"from django.contrib.auth.models import User"

So while writing the above line I only got suggestions for classes in the models. Didnt get any suggestion on modules in django or in the entire path before the import word.

Same is the case with project paths, only contents of the final module are suggested after writing the import word

Add autocompletion for ancestors methods

Most of the time, especially for webdev work, you are defining a new subclass of an abstract class provided by your framework, and most of the time it involves overriding its ancestors' methods. Is really convenient if SublimePythonIDE could also autocomplete all methods from all the ancestors of the current class I'm writing, right after the def keyword. The thing is this was already possible before switching to Jedi autocompletions, it just had the small annoyance that it autocompleted the name as a method call, that is, it inserted the parens and all arguments names when hitting Enter.

Can this be accomplished with the Jedi autocompletions?

Crash wenn trying to use Tab

Hi, when i try to use tab to see if the Plugins has completions, i get the following error:

Traceback (most recent call last):
File "/home/schildt/.config/sublime-text-3/Packages/SublimePython/sublime_python.py", line 84, in send_heartbeat
self.proxy.heartbeat()
File "X/xmlrpc/client.py", line 1090, in call
File "X/xmlrpc/client.py", line 1419, in __request
File "X/xmlrpc/client.py", line 1132, in request
File "X/xmlrpc/client.py", line 1143, in single_request
File "X/xmlrpc/client.py", line 1248, in send_request
File "X/http/client.py", line 932, in putrequest
http.client.CannotSendRequest: Request-sent

Therefore my log gets spammed with:
starting server on port 48762 with /usr/bin/python
and Sublime gets nearly unusable

Looks like some cases (typing within a string object for example) are killing the server. Maybe if i find some time, i will look into it

Completion hangs with Python 3.4.3

When I recently upgraded to Python 3.4.3 SublimePythonIDE stopped working properly and always hangs while typing. This issue does not exist with Python 3.4.2, I can reproduce that.

I'm on a Windows machine and I installed Python through conda.

The console shows recurring server starts roughly every 1-2 seconds with Python 3.4.3 as soon as I start typing:

 started server on port 52372 with C:\Miniconda3\envs\default\python.exe
 started server on port 52374 with C:\Miniconda3\envs\default\python.exe
 started server on port 52376 with C:\Miniconda3\envs\default\python.exe
 ...

Any idea what's happening here?

Feature request: show suggestions right after typing dot

Currently, a list of suggestions is shown only after the user has typed a dot and the first character. However, I think it'd be nice if we can configure PythonIDE such that a list of suggestions is shown after a user has typed a dot.

Linter highlights python file encoding line without reason

In some of my files SublimePythonIDE highlights the file encoding line and shows a exclamation mark in the gutter. When I click on it, nothing is shown in the status bar.

I have not yet been able to find out what exactly triggers this behaviour :( The console does not show anything conspicuous, either.

correct
false

Basic refactorings through rope

Hi,

SublimeRope was able to do quite a bit of refactoring (when it worked), but SublimePythonIDE doesn't seem to (although the README mentions refactorings explicitly).
Do you have any plans to add support for some rope refactorings in the near future?

If not, how are you refactoring in ST3? Block edit / copy-paste?

When installed through Package Control, "Settings - Default" menu has the wrong path

When installing SublimePythonIDE through Package Control, the package was put into a directory called "Python IDE".

The "Preferences > SublimePythonIDE > Settings - Default" menu option opens the file "${packages}/SublimePythonIDE/SublimePython.sublime-settings" when it should be opening "${packages}/Python IDE/SublimePython.sublime-settings".

Alternatively, Package Control should install SublimePythonIDE to "${packages}/SublimePythonIDE" instead of "${packages}/Python IDE".

Roadmap/Contributing

Hey,

I really liked using SublimeRope in ST2, and this looks great, and I was wondering if you had a roadmap for this and if I could contribute in any way.

Thanks for this and for SublimeRope!

--Derek

SublimePythonIDE missing from Package Control

I had the SublimePythonIDE plugin installed and noticed that a few days ago a message similar to this appeared (don't recall exactly the text between the commas):

The package specified, Python IDE, is not available

I unistalled the plugin, and tried to reinstall it, but it is not listed in Package Control.

Is somebody else having the same problem?

Package control installation : ImportError at startup

Hi,

I am getting an importerror when I start sublime.
It looks like the issue is installing from package control, as the project name is "Python IDE" and not "SublimePythonIDE".

reloading plugin Python IDE.sublime_python
reloading plugin Python IDE.sublime_python_linting
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 586, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1023, in load_module
  File "<frozen importlib._bootstrap>", line 1004, in load_module
  File "<frozen importlib._bootstrap>", line 562, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 869, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/data/home/max/.config/sublime-text-3/Packages/Python IDE/sublime_python_linting.py", line 11, in <module>
    from SublimePythonIDE.sublime_python import proxy_for, get_setting
ImportError: No module named 'SublimePythonIDE'

Plugin dont work in st3 stable build 3021

I tried to install plugin via package control and by cloning repository, but results was the same . Plugin appeared in list of installed packages in package control, but dont work - no commands in sublime command panel and no options in preferences menu, there is also no errors in sublime console.

End key does not work in visual mode

When in visual mode (after pressing 'v'), trying to go to the end of the line using the 'end' key will not work.

After this, trying to move using either the directional keys or home/end/pageup/pagedown will not work.

Exception in generate_color_scheme_async

I'm using the Base16 Color Schemes package to provide my preferred color scheme in Sublime, and when I installed SublimePythonIDE from package control, it generates this exception in the console:

Traceback (most recent call last):
  File "/home/jreese/profile/dotfiles/sublime3/Packages/SublimePythonIDE/sublime_python_colors.py", line 104, in generate_color_scheme_async
    color = color.lstrip('#')
AttributeError: 'NoneType' object has no attribute 'lstrip'
Traceback (most recent call last):
  File "/home/jreese/profile/dotfiles/sublime3/Packages/SublimePythonIDE/sublime_python_colors.py", line 116, in generate_color_scheme_async
    with open(scheme_path, 'w', encoding='utf8') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/jreese/profile/dotfiles/sublime3/Packages/Base16 Color Schemes/base16-tomorrow.dark.tmTheme'

The theme does not exist in this path because Sublime doesn't extract packages at runtime anymore.

AttributeError: 'NoneType' object has no attribute 'folders'

I'm getting the following traceback. Any ideas what's wrong? I've noticed recently that control + clicking on variables imported from different libraries has stopped working, could this be responsible?

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 215, in on_load_async
    callback.on_load_async(v)
  File "/Users/alex/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python_linting.py", line 411, in wrapper
    return func(self, view)
  File "/Users/alex/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python_linting.py", line 431, in on_load_async
    check(view)
  File "/Users/alex/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python_linting.py", line 76, in check
    proxy = proxy_for(view)
  File "/Users/alex/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python.py", line 285, in proxy_for
    python = project_venv_python(view) or system_python()
  File "/Users/alex/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python.py", line 250, in project_venv_python
    project_dir = root_folder_for(view)
  File "/Users/alex/Library/Application Support/Sublime Text 3/Packages/SublimePythonIDE/sublime_python.py", line 331, in root_folder_for
    "src_root", view, None)] + window.folders():
AttributeError: 'NoneType' object has no attribute 'folders'

Pyflakes out of date; breaks on Python 3.6 syntax with Python 3.6 interpreter

I've a project config of:

{
	"folders":
	[
		{
			"path": "."
		}
	],
    "settings": {
        "python_interpreter": "/Users/BenJolitz/.virtualenvs/cpython36/bin/python3.6",
    }
}

When I remove python_interpreter, the linter detects numerous issues like bad spacing, missing vars, etc,. Here is a sample where it should whine:

def bad():
    del a
    a.ax=1,  # <-- should whine about spacing at a minimum
    foo.bar.x
    foo(a)

When python_interpreter is set to Python 3, it no longer complains. I'm a bit uncertain how to proceed as I depend on the linter keeping me honest. For now, I add in things like 1=1 to provoke the linter to do its job.

Instructions for key bindings

I think I may be missing something obvious, but I've tried using the same key bindings from SublimeRope by adding them to my Keybindings - User file, but I don't see any response. SublimePythonIDE seems to be installed successfully as autocomplete and linting are working fine.

Switch to Jedi for completions

As noticed by many others, Rope is not the perfect library for autocompletion.
I have pushed a new branch jedi_completions that uses Jedi instead.

Anyone who is interested is invited to give it a try.

Linting isn't working

I'm using ST3 3407 build on Linux with latest version of this plugin.

I noticed that linting doesn't work anymore, though it did some time ago.

Is there a way to start lint manually via some setting or in console?

Error on installing: sublime_python_colors.py line 94, in generate_color_scheme_async

Having installed the plugin via Package Control, I got the error in Sublime's console:

Traceback (most recent call last):
  File "C:\Users\User1\AppData\Roaming\Sublime Text 3\Packages\SublimePythonIDE\sublime_python_colors.py", line 94, in generate_color_scheme_async
    target_color = colors.get(style, DEFAULT_MARK_COLORS[style]).upper().lstrip("#")
AttributeError: 'NoneType' object has no attribute 'upper'

Sublime Build: 3074
OS: Windows 8.1 x64

Can't tell if it even works

I haven't used SublimeRope before ( actually I've only started learning python... again ) so I don't really know what I should be expecting from this plugin, but I don't see anything new.

I'm using OSX and there are no new options on the toolbar, when I type I experience massive slowdowns on each letter as if the plugin was scanning for possible autocompletions, but it only shows ST3 built-in snippets. I've tried to get autocompletion to show me functions / methods like print, input or [].append

I would like Some kind of a readme on how to set up the plugin and the features it gives โ€“ where to look for them and how to use them.

OSError: Could not detect python...

Hi dev Julian!

I had problems with setting the Python interpreter right on my Win7 x86 machine. I've installed a WinPython where Python is located at "C:\Program Files\WinPython-32bit-3.3.3.3\python-3.3.3\python.exe". The space in "Program Files" caused the problem. Setting the SublimePython user-settings gives me a value error window on startup. Setting it in Settings - User also doesn't do the trick.
Troubleshooting the code I found that the python local on line 285 in proxy_for(view) of sublime_python.py is set to C:\\Program. Tracing the source of this value I found the following on line 225:

sys_py = sys_py.split()[0]  # use first result where many might return

But the result of the where clause in cmd contains a space! So I changed it to:

sys_py = sys_py.strip()

Now it works flawless:

started server on port 51965 with C:\Program Files\WinPython-32bit-3.3.3.3\python-3.3.3\python.exe

Might this help some others too?

Command to go to the next error

Could you add a command, SublimeLinter-like, to move to the next detected error? That way I can quickly zip through a file and address them without scrolling until I manually spot something.

Modifying sys.path breaks other packages

SublimePythonIDE modifies sys.path for the whole Python interpreter embedded in ST3 by injecting its own lib/ dependency there. This happens in here:

https://github.com/JulianEberius/SublimePythonIDE/blob/master/sublime_python.py#L12

This has a potential of breaking other plugins / packages which rely on the same libraries, different versions.

This occurs with SublimeLinter-flake8. SublimeLinter-flake8 assues flake8 > 2.1.0, but SublimePythonIDE sys.path mutation forces it to use older, incompatible, version.

The issue is reported here:

SublimeLinter/SublimeLinter-flake8#4

If possible the bundled dependency libraries should be loaded without modifying sys.path. I am pretty sure this is possible with Python 3's imp module.

(Document that) the Extract Method refactoring only works with python 2

First of all, I really value having Extract Method available in sublime, so thanks for creating this plugin.

When I start sublime from a shell that uses Python2 then the Extract Method refactoring works fine. It fails when starting from a shell that uses Python3. Maybe a small note can be added to the readme to alert users to this?

'module' object has no attribute 'ReturnOutsideFunction'

My Sublime recently updated to the most recent SublimePythonIDE version and no longer parses valid Python code in my Flask project.

The console prints:

SublimePythonIDE: No server response
'module' object has no attribute 'ReturnOutsideFunction'

When I terminate the server.py program, I see:

started server on port 57389 with ['/Users/BenJolitz/.virtualenvs/cpython27/bin/python']
SublimePythonIDE: No server response
'module' object has no attribute 'ReturnOutsideFunction'

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.