searchcode-server icon indicating copy to clipboard operation
searchcode-server copied to clipboard

Allow set folder separator for display purposes

Open quasarea opened this issue 8 years ago • 3 comments

Would be great to have parameter allowing to change folder separator from / to \

In many cases we end up coping path from result but then manually have to replace all separators

Thanks J

quasarea avatar Jun 14 '17 13:06 quasarea

Where did you see this being used? In the properties file? Need more detail.

boyter avatar Jun 14 '17 22:06 boyter

If you use https://searchcode.com/?q=jquery header of each result will be like: jquery-1.5.1.js in RealtimeMultiplayerNodeJs git://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs.git | 8316 lines | Javascript Show 100 matches

In my case its: ReportWizard.cs in repo009 | /branch/Core/ReportingControls/ReportWizard.cs | 212 lines | C#

if its file repo, linux notation is quite handy, I'm aware of the bug there, and git repos it should be: ReportWizard.cs in repo009 | git://localhost/branch/ReportingControls/ReportWizard.cs | 212 lines | C#

but for file repos, it would be great if we could have control over usage of \ or / so in my case it would be: ReportWizard.cs in repo009 | \branch\Core\ReportingControls\ReportWizard.cs | 212 lines | C#

I think if I would try to cover it, I would expose two additional properties on repository model, (unless 'Repository Source' is for such sole purpose)

  • Result Path Prefix, string, i.e 'git://', 'http://tfsserver:8080/tfs/branch/team/', 'c:\', '\home'
  • Result Path Separator, combo of '\', '/' or 'linux (web)', 'windows'

Maybe even do some run-time string interpolation, that would allow us to pinpoint the file location, if you could provide a way to utilise other repository properties, so it could cover #78 as well, example:

  • Current Result Path Prefix would be: /${repo.Name}/${result}
  • While to cover #78 I would set it to just to: /${result}
  • In some cases it could be even https://${repo.User}:${repo.Pass}@github.com/${repo.Name]/${result}
  • or TFS like http://tfsserver:8080/tfs/${repo.name}/_versionControl?path=${result}

But I don't think you could do (at least I failed in implementing that in c#, but will keep trying):

  • C:\Sources\${repo.Name}\${result.split('/').join('\')}

quasarea avatar Jun 16 '17 10:06 quasarea

Sounds useful. Will look into integrating it at some point soon.

boyter avatar Jun 18 '17 20:06 boyter