Skip to content
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

Breakpoint labels start with slashes #29239

Closed
roblourens opened this issue Jun 22, 2017 · 8 comments
Closed

Breakpoint labels start with slashes #29239

roblourens opened this issue Jun 22, 2017 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

image

@isidorn
Copy link
Contributor

isidorn commented Jun 22, 2017

fyi @bpasero I believe you have broke this via f2e1911
In https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/labels.ts#L31

Though I fixed it on my side since your changeset was large

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Jun 22, 2017
@isidorn isidorn added this to the June 2017 milestone Jun 22, 2017
@bpasero bpasero reopened this Jun 26, 2017
@bpasero
Copy link
Member

bpasero commented Jun 26, 2017

@isidorn I see. however I question the use of getPathLabel() for your usecase: you seem to pass in the basename of a path to getPathLabel() which is actually only useful for absolute paths. basename will return the name of a file or folder, so why not just use it directly then?

Reopening to consider dropping getPathLabel with a path that is just the basename:

@isidorn
Copy link
Contributor

isidorn commented Jun 26, 2017

@bpasero thanks for pointing this out, however what I need is the basename inside the workspace thus I am using the getPathLabel. Example for path
Users/isidor/developement/w/standup/server/app.js I want to show just the server, that is the basename inside my standup workspace.
I could not get this to work only using the paths.basename but would also have to use the paths.relative. Which seems like the same of using getPathlabel() in combination with basename.
Let me know what you think is the best approach

@bpasero
Copy link
Member

bpasero commented Jun 26, 2017

@isidorn a combination of path.dirname and path.basename should do it, no?

@isidorn
Copy link
Contributor

isidorn commented Jun 26, 2017

@bpasero no. As mentioned above the combination of relative and basename would do it:
paths.relative(contextService.getWorkspace().resource, paths.basename(uri.fsPath))

@bpasero
Copy link
Member

bpasero commented Jun 26, 2017

@isidorn can you not do basename(contextService.getRoot(resource))?

@isidorn
Copy link
Contributor

isidorn commented Jun 26, 2017

No, if you are refereing to our paths.basename. That would just return standup for my example above.

I could use the node native basename and pass both basename(uri, contextService.getRoot(uri))

@bpasero
Copy link
Member

bpasero commented Jun 26, 2017

@isidorn both methods should do the same thing:

  • basename: returns the last segment of a path (/foo/bar/test.txt => test.txt)
  • dirname: all the segments up to the last segment (/foo/bar/test.txt => /foo/bar)

Maybe you can show me tomorrow at your desk what you want to achieve.

@weinand weinand added the verified Verification succeeded label Jun 28, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants