Git Product home page Git Product logo

Comments (8)

l1997i avatar l1997i commented on August 11, 2024 1

All bug fixed! Thanks so much!

from vscode-inline-parameters.

RobertOstermann avatar RobertOstermann commented on August 11, 2024

@l1997i I do not work in Python much and did not realize that using the f-strings would only work with versions of Python >= 3.6. Thanks for making me aware of that! I have added a fix in commit ffbc5a0, which hopefully solves the problem by using string concatenation with the + operator instead of using f-strings.

I have also added a inline-parameters.python.executablePath setting that allows you to change that command to use python3 instead of the default python.

I have published version 1.1.2. please try that version and let me know if the program now works with Python2 or Python3 versions earlier than 3.6

from vscode-inline-parameters.

l1997i avatar l1997i commented on August 11, 2024

Still doesn't work. I've set inline-parameters.python.executablePath to python3, but the output says it still runs on Python2.7, which will cause 'Num' object has no attribute 'end_lineno' error.

Traceback (most recent call last):
  File "/home/luis/.vscode-server/extensions/robertostermann.inline-parameters-extended-1.1.2/out/src/python/helpers/main.py", line 39, in <module>
    main()
  File "/home/luis/.vscode-server/extensions/robertostermann.inline-parameters-extended-1.1.2/out/src/python/helpers/main.py", line 10, in main
    analyzer.visit(tree)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/lib/python2.7/ast.py", line 249, in generic_visit
    self.visit(item)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/usr/lib/python2.7/ast.py", line 251, in generic_visit
    self.visit(value)
  File "/usr/lib/python2.7/ast.py", line 241, in visit
    return visitor(node)
  File "/home/luis/.vscode-server/extensions/robertostermann.inline-parameters-extended-1.1.2/out/src/python/helpers/main.py", line 21, in visit_Call
    argument_end_line = "argument end line: " + str(argument.end_lineno)
AttributeError: 'Num' object has no attribute 'end_lineno'

By the way, I also manually run the command using Python3,

python3 /home/luis/.vscode-server/extensions/robertostermann.inline-parameters-extended-1.1.2/out/src/python/helpers/main.py /home/luis/test/test.py

it works,

expression line: 4 | expression character: 0 | argument start line: 4 | argument start character: 4 | argument end line: 4 | argument end character: 5
expression line: 4 | expression character: 0 | argument start line: 4 | argument start character: 7 | argument end line: 4 | argument end character: 8
NEW EXPRESSION

from vscode-inline-parameters.

l1997i avatar l1997i commented on August 11, 2024

I've fix this and make a pull request #5.

from vscode-inline-parameters.

RobertOstermann avatar RobertOstermann commented on August 11, 2024

@l1997i Did you reload your VSCode window after changing the Python path environment variable? I think it should work after reload and I can add a popup to let users know that.

from vscode-inline-parameters.

l1997i avatar l1997i commented on August 11, 2024

@l1997i Did you reload your VSCode window after changing the Python path environment variable? I think it should work after reload and I can add a popup to let users know that.

@RobertOstermann Yes, I have. I even reopen the VS Code.

from vscode-inline-parameters.

RobertOstermann avatar RobertOstermann commented on August 11, 2024

Ok, I have published version 1.1.3 with changes from 4daccfc that should allow Python 2.7 to work with this extension. I also added the Python command that is being run in the inline-parameters-extended output tab. That might show that python3 is being run correctly? If not I am not sure why it is not respecting the setting, but I looked at your PR #5 and like the idea of using the ms-python extension setting for the python path. I will get that merged and push out a new version with those changes.

from vscode-inline-parameters.

RobertOstermann avatar RobertOstermann commented on August 11, 2024

@l1997i I have merged your changes and slightly altered them in 078dbe7 to allow for the configured path to take priority when it is set. I published version 1.1.4 with those changes. Let me know if that fixes all the bugs you were seeing.

from vscode-inline-parameters.

Related Issues (15)

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.