Skip to content

Commit

Permalink
fixed mapper when no changes were done
Browse files Browse the repository at this point in the history
  • Loading branch information
gmit3 committed Oct 25, 2023
1 parent d06204c commit b77252d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/OmniSharp.Roslyn/EvolveUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal class EvolveUI
{
private static readonly Dictionary<DocumentId, EvolveUIMapper> _mappers = new();

public static bool ShouldProcess(string filepath) => false;//filepath?.EndsWith(".ui", StringComparison.CurrentCultureIgnoreCase) ?? false;
public static bool ShouldProcess(string filepath) => filepath?.EndsWith(".ui", StringComparison.CurrentCultureIgnoreCase) ?? false;
public static bool ShouldProcess(Document document) => ShouldProcess(document?.FilePath);

public static EvolveUIMapper GetOrAddMapper(Document document)
Expand Down
8 changes: 4 additions & 4 deletions src/OmniSharp.Roslyn/EvolveUIMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public SourceText ApplyText(SourceText source_text, bool force = false)
if (source_text == null)
return null;
if ((original_source?.ContentEquals(source_text) ?? false) && !force)
return null;
return modified_source;

this.modified_source = this.original_source = source_text;
chunks.Clear();
Expand All @@ -101,18 +101,18 @@ public SourceText ApplyText(SourceText source_text, bool force = false)
return modified_source;
}

// private readonly string processed_marker = "<<EvolveUI processed marker>>";
private readonly string processed_marker = "<<EvolveUI processed marker>>";
private void ProcessSource()
{
/* Debug.Assert(!original_string.Contains(processed_marker));
Debug.Assert(!original_string.Contains(processed_marker));

// #TODO: inserting the same single point won't work yet
InsertLine(0, $"// {processed_marker} blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip");
// InsertLine(0, "// blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip");
// InsertLine(0, "// blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip blip");
Replace("template AppRoot : AppRoot", "class __evolveUI__AppRoot");
ReplaceAll("state", "");
ReplaceAll("[@", "\"xx-style-xx\"", "]");*/
ReplaceAll("[@", "\"xx-style-xx\"", "]");
}

public void TextChanged()
Expand Down
3 changes: 3 additions & 0 deletions vscodelauncher/vscodelauncher.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>del /f /s /q C:\Users\gmit\AppData\Roaming\Code\Backups\*</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
Expand Down

0 comments on commit b77252d

Please sign in to comment.