Closed joonas-yoon closed 3 years ago
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.
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
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
Hi, I just started with this and thanks for sharing.
I am trying to implement word completion in quick pick with items which files in working directory.
thus I tried as like this:
As I expected,
cwd = '<project root directory as workspace>'
like~/vscode-ext-example/
but actually it iscwd = C:\Users\joonasyoon\AppData\Local\Programs\Microsoft VS Code
how can I get current directory for that?