Skip to content

Path suggestion - Bug or "by design"?! #2577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
homezonebenny opened this issue Mar 23, 2020 · 2 comments
Closed

Path suggestion - Bug or "by design"?! #2577

homezonebenny opened this issue Mar 23, 2020 · 2 comments
Labels

Comments

@homezonebenny
Copy link

homezonebenny commented Mar 23, 2020

Hello,
first here's a screenshot of what happens:
Imgur VSCode Screenshot

File structure

  • .\workspace\
  • .\workspace\Test.code-workspace
  • .\workspace\Guides\
  • .\workspace\Tests\
  • .\workspace\PowerShell-Tests\
  • .\workspace\PowerShell-Tests\Hash\Write-Hash-List.ps1
  • .\workspace\Default-Application\

Explanation

If you open a VSCode Test.code-workspace file like this:

{
  "folders": [
    {
      "name": "Guides",
      "path": "Guides"
    },
    {
      "name": "Tests",
      "path": "Tests"
    },
    {
      "name": "PowerShell-Tests",
      "path": "PowerShell-Tests"
    },
    {
      "name": "Default",
      "path": "Default-Application"
    }
  ]
}

And you are inside of this file:
.\Workspace\PowerShell-Tests\Hash\Write-Hash-List.ps1
See screenshot point ( 3 ) and ( 4 )

You do not get the right file suggestion in the list (CTRL+Space).
See screenshot ( 4 )!

It seems that you only get the first "Project Folder" suggestions, instead of the suggestions around the file you are in.

In my case:
.\workspace\PowerShell-Tests\Hash\Write-Hash-List.ps1

The blue marked boxes are the other added "project folders" inside of this:
.\workspace\Test.code-workspace

 

But if you are using this a single project only like this:
.\workspace\Test-2.code-workspace

{
  "folders": [
    {
      "name": "PowerShell-Tests",
      "path": "PowerShell-Tests"
    }
  ]
}

The file suggestion works perfect, see screenshot:
( 1 ) and ( 2 )

Conclusion

I'm not sure if this is related to PowerShell-Plugin or to VSCode itself at all.
If this is a general VSCode issue or "by design" I'm thankfull for the answer and I'll forward it to another place. 👍 :-)

For me it would be better that the "File suggestion" goes from the "file itself" to find other elements.


OR better it should:

  • Check the file position
  • Check in which "project folder" the file is
  • Make suggestion list based on project folder you are in / file position


Another problem I faced is that sometimes functions like:
$xmlDoc.Save($fullPath)

Are not working with "relative" pathes...
Inside of VSCode it saves on different location than execute the file in windows explorer directly with powershell. Strange behaviour.
But that's another topic itself. :-P


EDIT:

I figured out that when I have multiple folders added to a workspace like mentioned in this question:

  • I can't CTRL+Click a powershell function to jump into the other powershell file where the code is

When I open a workspace with only one folder added then:

  • I can CTRL+Click a function to jump into the other powershell file
@ghost ghost added the Needs: Triage Maintainer attention needed! label Mar 23, 2020
@SydneyhSmith
Copy link
Collaborator

@homezonebenny thanks for opening this issue, this is related to a larger issue which is our limited support for multiple workspaces, currently we are tracking this ask with the following issue #2153 so I will mark this as a duplicate. Thanks!

@SydneyhSmith SydneyhSmith added Area-Workspaces Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Mar 24, 2020
@ghost
Copy link

ghost commented Mar 25, 2020

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Mar 25, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants