Spyder: Add path autocompletion to the Editor

Created on 20 Oct 2017  路  5Comments  路  Source: spyder-ide/spyder

Description of your problem

What steps will reproduce the problem?

  1. Path autocompletion, i.e. 'C:/MyFiles/' is not available in the editor window, only in the console.

What is the expected output? What do you see instead?

This would be a really useful enhancement from a data processing perspective. One of the features I love about Rstudio is that I can locate my files in deeply nested directories very quickly using tab-autocompletion.

Editor Enhancement

Most helpful comment

@andfoy, this will be made possible by updating Jedi to 0.15.2 in PR #11809. So if you write in the Editor:

'/ho<Tab>'

you'll get

'/home/'

However, that only works when code snippets are deactivated. If they are activated, you'll get this error:

  File "/home/carlos/Projects/spyder/github-repo/spyder/plugins/editor/extensions/snippets.py", line 814, in insert_snippet
    ast = build_snippet_ast(text)
  File "/home/carlos/Projects/spyder/github-repo/spyder/utils/snippets/ast.py", line 154, in build_snippet_ast
    peek_token
SyntaxError: Syntax Error: Expected any of the following characters: ['dollar', 'name', 'int', 'case', '\\:', '\\$', 'text_pipe', '{', '\\}', '\\', '\\/', '\\,', 'symbol', 'whitespace', 'left_curly_name', ':', ':+', ':-', ':?', ',', '<eof>', '}'], got <slash, />

Please take care of that.

All 5 comments

Thanks for reporting. We'll consider this for a future release.

This is just to support previous request from @stevenpawley

Awesome that you have added file path autocompletion for the iPython console in spyder 4.0. Thanks a lot!
Hope to see the functionality also in the editor in a near future release

+1, would love to see this in spyder as well!

Bumping to 4.2 @ccordoba12 ?

@andfoy, this will be made possible by updating Jedi to 0.15.2 in PR #11809. So if you write in the Editor:

'/ho<Tab>'

you'll get

'/home/'

However, that only works when code snippets are deactivated. If they are activated, you'll get this error:

  File "/home/carlos/Projects/spyder/github-repo/spyder/plugins/editor/extensions/snippets.py", line 814, in insert_snippet
    ast = build_snippet_ast(text)
  File "/home/carlos/Projects/spyder/github-repo/spyder/utils/snippets/ast.py", line 154, in build_snippet_ast
    peek_token
SyntaxError: Syntax Error: Expected any of the following characters: ['dollar', 'name', 'int', 'case', '\\:', '\\$', 'text_pipe', '{', '\\}', '\\', '\\/', '\\,', 'symbol', 'whitespace', 'left_curly_name', ':', ':+', ':-', ':?', ',', '<eof>', '}'], got <slash, />

Please take care of that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JesterEE picture JesterEE  路  3Comments

impact27 picture impact27  路  3Comments

goanpeca picture goanpeca  路  3Comments

keith-golden picture keith-golden  路  3Comments

spyder-bot picture spyder-bot  路  3Comments