mayerwin / vs-customize-window-title

Customize Visual Studio Window Title - Visual Studio Extension
https://marketplace.visualstudio.com/items?itemName=mayerwin.RenameVisualStudioWindowTitle
MIT License
108 stars 30 forks source link

Global override settings not being picked up #14

Closed headsphere closed 7 years ago

headsphere commented 7 years ago

Hi there - I have a global settings file set up to configure furthest parent depth, due to the structure of my SVN repository. The actual branch name in the path is configured to be a wildcard.

I have saved this file and configured the add-in to look at this config file using the "global settings override file path" setting. The problem is, however that the settings are completely ignored. The settings are being overridden by what is in the config dialog window, not the config file.

Is there somewhere else I need to set the addin to look at the config file, not at the config that is set up in the dialog window? Or is there something wrong with my config file? I've tried toggling the debug output but it doesn't give me any information apart from "RenameVSWindowTitle: Debugger context changed. Updating title."

Thanks!

<?xml version="1.0" encoding="utf-8"?>
<RenameVSWindowTitle>
  <SettingsSet
    Path="C:\SVN\branches\*\Primary\SubDir\MySolution-Primary.sln"
    SolutionName="MySolution-Primary"
    ClosestParentDepth="1"
    FarthestParentDepth="3"
    AppendedString="*"
    PatternIfRunningMode="[parentPath]\[solutionName] (Running) - [ideName]"
    PatternIfBreakMode="[parentPath]\[solutionName] (Debugging) - [ideName]"
    PatternIfDesignMode="[parentPath]\[solutionName] - [ideName]" />
  <SettingsSet
    Path="C:\SVN\branches\*\Secondary\MySolution-Secondary.sln"
    SolutionName="MySolution-Secondary"
    ClosestParentDepth="1"
    FarthestParentDepth="2"
    AppendedString="*"
    PatternIfRunningMode="[parentPath]\[solutionName] (Running) - [ideName]"
    PatternIfBreakMode="[parentPath]\[solutionName] (Debugging) - [ideName]"
    PatternIfDesignMode="[parentPath]\[solutionName] - [ideName]" />
</RenameVSWindowTitle>
mayerwin commented 7 years ago

Can you confirm you set "Enable solution-specific overrides" to true? This is necessary even for global configs (as global configs are still applied at the solution level with the wildcard).

You can also recheck to make sure the path actually listed in the input matches yours.

Let me know if this doesn't solve the issue.

lexx9999 commented 7 years ago

Wildcard-matching is case sensitive, maybe that's an issue...

Does it work without wildcard in the path? Is your config file opened when you click "open global config"?

@mayerwin To fix case sensitivity, I recommend to change this. (path.Contains("") || path.Contains("?")) && new Wildcard(path / add here: */, RegexOptions.IgnoreCase).IsMatch(settings.SolutionFilePath);

mayerwin commented 7 years ago

Very good point, I'll change that as it can be rather unexpected for paths on Windows, and exact matches are already compared without the case.

mayerwin commented 7 years ago

I am in the middle of migrating the extension to support VS 2017.

mayerwin commented 7 years ago

I will also update the description of "Enable solution-specific overrides" to make it clear that it is needed for the global config file as well.

headsphere commented 7 years ago

Thanks @mayerwin - that solved the problem

One other little thing however, I noticed that setting ClosestParentDepth, FarthestParentDepth don't seem to have any effect when setting them from a global config. The other attributes work fine, and indeed I can achieve what I want using the [parent:X] tags so its not a big issue, but thought I'd let you know to see if you can reproduce it on your machine

mayerwin commented 7 years ago

Good point, this is indeed a bug. I am fixing this right now and releasing a new version (3.4.1).

ophite commented 7 years ago

What about VS 2017 ? I installed it - but seems to be it does not work

mayerwin commented 7 years ago

This should work normally. Can you clarify what is the issue you are encountering?

ophite commented 7 years ago

installed - but nothing changed (no full path in title)

lexx9999 commented 7 years ago

@ophite By default it doesn't show the full path, just the direct parent folder name. Do you see an asterisk ("*") at the end of the title? Do you see a section "Customize VS Window title" in options?

ophite commented 7 years ago

Thanx all works) But maybe add some example (image) how to setup, for faster understand

lexx9999 commented 7 years ago

Actually there are a number of ways to see the full path. The simplest is goto options "Customize VS Window title" - "Global rules" and set "Farthest parent folder path" to 99 (or any high enough number).

To see the full path including ".sln" you can replace "[parentPath][solutionName]" with "[parent:99:0]" in all patterns. You can use the pattern editor to preview the result, as you can see in the screenshot. image