GithubHelp home page GithubHelp logo

Comments (3)

joonas-yoon avatar joonas-yoon commented on August 26, 2024

Oh, I found what it called. it is showWorkspaceFolderPick.

And as far as I can see in this repo, there is no object/class for vscode.workspace. I think it is related to my issue.

from vscode.py.

CodeWithSwastik avatar CodeWithSwastik commented on August 26, 2024

Yes this hasn't been implemented yet, I'll add this to the todo. Thanks for pointing this out.

As a work around, I think you can use TextDocument.uri to get the path of the current TextDocument and you can parse the workspace directory from it.

editor = vscode.window.ActiveTextEditor()
uri = editor.document.uri

from vscode.py.

joonas-yoon avatar joonas-yoon commented on August 26, 2024

Yes this hasn't been implemented yet, I'll add this to the todo. Thanks for pointing this out.

As a work around, I think you can use TextDocument.uri to get the path of the current TextDocument and you can parse the workspace directory from it.

editor = vscode.window.ActiveTextEditor()
uri = editor.document.uri

Thanks for your reply, but it is not working.

An Error occurred in the python script: Traceback (most recent call last):
  File "~\vscode-ext-test\build\extension.py", line 207, in <module>
    ipc_main()
  File "~\vscode-ext-test\build\extension.py", line 205, in ipc_main
    globals()[sys.argv[1]]()
  File "~\vscode-ext-test\build\extension.py", line 195, in sort_file
    filename = search()
  File "~\vscode-ext-test\build\extension.py", line 171, in search
    cwd = editor.document.uri
AttributeError: 'ActiveTextEditor' object has no attribute 'document'

What should I do? I have no idea why document in it is not setting up

from vscode.py.

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.