]> O.S.I.I.S - jp/crowedit.git/commitdiff
wip SyntaxTokensAsIndices
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 21 Jul 2022 16:52:14 +0000 (18:52 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 21 Jul 2022 16:52:14 +0000 (18:52 +0200)
13 files changed:
CrowEdit.csproj
CrowEditBase/src/Plugin.cs
CrowEditBase/ui/CrowEdit.style
plugins/CECrowPlugin/CECrowPlugin.csproj
plugins/CECrowPlugin/src/CrowService.cs
plugins/CECrowPlugin/ui/EnumSelector.template
plugins/CECrowPlugin/ui/winConfiguration.crow
plugins/CENetcoreDbgPlugin/CENetcoreDbgPlugin.csproj
plugins/CENetcoreDbgPlugin/default.conf [new file with mode: 0644]
plugins/CENetcoreDbgPlugin/src/NetcoreDbgService.cs
plugins/CENetcoreDbgPlugin/ui/winConfiguration.crow
plugins/CERoslynPlugin/src/RoslynService.cs
plugins/CERoslynPlugin/src/SolutionProject.cs

index 0bae25370daa61e8c7c9f91561285d7550161333..4132a1d5a15d3deaff56bffb30fb76da535ad7a2 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
-               <TargetFramework>netcoreapp3.1</TargetFramework>
+               <TargetFramework>net5</TargetFramework>
                <OutputType>WinExe</OutputType>
                <EnableDefaultItems>false</EnableDefaultItems>
        </PropertyGroup>
index 55950bddc4af8321ac817b7337c790ce700443bd..aa67fc3cbf09d3d8e840e71a5f27fc775383a117 100644 (file)
@@ -72,7 +72,7 @@ namespace CrowEditBase
                                string mainService = config.Get<string> ("MainService");
                                if (!string.IsNullOrEmpty (mainService)) {
                                        serviceClass = loadContext.MainAssembly.GetType (mainService);
-                                       App.GetService (serviceClass)?.Start();
+                                       App.GetService (serviceClass);//instantiate service without starting it
                                }
                                string fileAssociations = config.Get<string> ("FileAssociations");
                                if (!string.IsNullOrEmpty (fileAssociations)) {
index 17c4d568eed222e5c9448e0a1fbbcf6f4e2c49a0..e94bbc02e1e4153e448860d4622a5facf39bf63a 100644 (file)
@@ -140,4 +140,7 @@ CheckBox {
        Unchecked = "{Background=${ControlIdle}}";
        MouseEnter = "{Foreground=${ControlCaptionHoverColor}}";
        MouseLeave = "{Foreground=${ControlForeground}}";
+}
+LogViewerWidget {
+       Background = "0.01,0.01,0.01,1";
 }
\ No newline at end of file
index 1a634b7054513bcee5f0ef6b7f0f982a2874912b..67b653ff8eca59f9641973e6eb7e1eadee4cacd5 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
-               <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
+               <TargetFrameworks>net5</TargetFrameworks>
                <EnableDefaultItems>false</EnableDefaultItems>
        </PropertyGroup>
 
index 62b275381c9d37b4357b910da5aa8d81c5d02123..b94452819a079b9e777d8489ff13949a278329d4 100644 (file)
@@ -138,11 +138,12 @@ namespace Crow
                Action<double> delSetZoomFactor;
 
 
-               FieldInfo fiDbg_IncludeEvents, fiDbg_DiscardEvents, fiDbg_ConsoleOutput, fiDbgIFace_MaxLayoutingTries, fiDbgIFace_MaxDiscardCount, fiDbgIFace_Terminate;
+               FieldInfo fiDbg_IncludedEvents, fiDbg_ConsoleOutput, fiDbgIFace_MaxLayoutingTries, fiDbgIFace_MaxDiscardCount, fiDbgIFace_Terminate;
                #endregion
 
                bool recording, debugLogIsEnabled;
-               DbgEvtType recordedEvents = DbgEvtType.Widget, discardedEvents;
+               IList<DbgEvtType> recordedEvents = new ObservableList<DbgEvtType>(new DbgEvtType[] {DbgEvtType.Widget} );
+               DbgEvtType addRecordedEvents = DbgEvtType.None;
                public bool HasVkvgBackend { get; private set; }
                public int RefreshRate {
                        get => Configuration.Global.Get<int> ("RefreshRate", 10);
@@ -202,41 +203,37 @@ namespace Crow
                                        return;
                                recording = IsRunning & DebugLogIsEnabled & value;
                                if (recording) {
-                                       fiDbg_DiscardEvents.SetValue (dbgIFace, DiscardedEvents);
-                                       fiDbg_IncludeEvents.SetValue (dbgIFace, RecordedEvents);
+                                       fiDbg_IncludedEvents.SetValue (dbgIFace, RecordedEvents.ToList());
                                        CMDStartRecording.CanExecute = false;
                                        CMDStopRecording.CanExecute = true;
                                } else {
-                                       fiDbg_DiscardEvents.SetValue (dbgIFace, DbgEvtType.All);
-                                       fiDbg_IncludeEvents.SetValue (dbgIFace, DbgEvtType.None);
+                                       fiDbg_IncludedEvents.SetValue (dbgIFace, new List<DbgEvtType>());
                                        CMDStartRecording.CanExecute = debugLogIsEnabled;
                                        CMDStopRecording.CanExecute = false;
                                }
                                NotifyValueChanged(recording);
                        }
                }
-               public DbgEvtType RecordedEvents {
+               public IList<DbgEvtType> RecordedEvents {
                        get => recordedEvents;
                        set {
                                if (recordedEvents == value)
                                        return;
                                recordedEvents = value;
                                if (Recording)
-                                       fiDbg_IncludeEvents.SetValue (dbgIFace, value);
+                                       fiDbg_IncludedEvents.SetValue (dbgIFace, value);
                                NotifyValueChanged (recordedEvents);
                        }
                }
-               public DbgEvtType DiscardedEvents {
-                       get => discardedEvents;
+               public DbgEvtType AddRecordedEvents {
+                       get => addRecordedEvents;
                        set {
-                               if (discardedEvents == value)
+                               if (addRecordedEvents == value)
                                        return;
-                               discardedEvents = value;
-                               if (Recording)
-                                       fiDbg_DiscardEvents.SetValue (dbgIFace, value);
-                               NotifyValueChanged (discardedEvents);
+                               addRecordedEvents = value;
+                               NotifyValueChanged (addRecordedEvents);
                        }
-               }
+               }               
                public string DebugLogFilePath {
                        get => Configuration.Global.Get<string> ("DebugLogFilePath");
                        set {
@@ -361,8 +358,7 @@ namespace Crow
                                fiDbgIFace_MaxLayoutingTries = dbgIfaceType.GetField("MaxLayoutingTries", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
                                fiDbgIFace_MaxDiscardCount = dbgIfaceType.GetField("MaxDiscardCount", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
 
-                               fiDbg_IncludeEvents = debuggerType.GetField("IncludeEvents");
-                               fiDbg_DiscardEvents = debuggerType.GetField("DiscardEvents");
+                               fiDbg_IncludedEvents = debuggerType.GetField("IncludedEvents");
                                fiDbg_ConsoleOutput = debuggerType.GetField("ConsoleOutput");
                                delResetDebugger = (Action)Delegate.CreateDelegate(typeof(Action), null, debuggerType.GetMethod("Reset"));
                                /*delSaveDebugLog = (Action<object, string>)Delegate.CreateDelegate(typeof(Action<object, string>),
@@ -447,14 +443,13 @@ namespace Crow
                                crowAssemblies.Add (a);
                }
 
-
-
                protected override void onStateChange(Status previousState, Status newState)
                {
                        base.onStateChange(previousState, newState);
                        CMDRefresh.CanExecute = IsRunning;
                }
-               #region Mouse & Keyboard
+               
+               #region Mouse & Keyboard                
                Point mouseScreenPos;//absolute on screen position.
                public void onKeyDown(KeyEventArgs e)
                {
@@ -549,6 +544,7 @@ namespace Crow
                        }
                }
                #endregion
+
                public ISurface MainSurface => IsRunning ? delGetMainSurface() : null;
                public void Resize (int width, int height) {
                        if (IsRunning)
index 9b8cdfab748fbb4d60a767a9463c2ebe207066ae..b0a9f25377d445777e32b0b6ca3ff08c854fecd9 100644 (file)
@@ -6,5 +6,5 @@
                        <Label Background="SeaGreen" Text="{../../../EnumValue}" Margin="3"/>
                </HorizontalStack>
        </Template>     
-       <Wrapper Name="Content" Height="Fit" Width="420" Background="Jet" Orientation="Vertical" />     
+       <Wrapper Name="Content" Height="Fit" Width="700" Background="Jet" Orientation="Vertical" />     
 </Popper>
\ No newline at end of file
index 2f387898fe63221f65d08ab8241f9b9aebd2cf90..03c5c9951e353290e66bc9fca47502c94e261225 100644 (file)
                <Spinner Caption="Refresh Rate (ms)" Value="{²RefreshRate}" Maximum="1000"/>
                <Spinner Caption="Max Layout Try" Value="{²MaxLayoutingTries}" Maximum="1000"/>
                <Spinner Caption="Max Layout Discard" Value="{²MaxDiscardCount}" Maximum="1000"/>
-               <GroupBox Caption="Debug Logger" IsEnabled="{DebugLogIsEnabled}">
-                       <VerticalStack>
-                               <EnumSelector RadioButtonStyle="CheckBox2" Template="#CECrowPlugin.ui.EnumSelector.template" Width="Stretched"
-                                       Caption="Recorded Events" EnumValue="{²RecordedEvents}" BitFieldExcludeMask="255" />
-                               <EnumSelector RadioButtonStyle="CheckBox2" Template="#CECrowPlugin.ui.EnumSelector.template" Width="Stretched"
-                                       Caption="Discarded Events" EnumValue="{²DiscardedEvents}" BitFieldExcludeMask="255" />
-                               <!--<HorizontalStack Height="Fit">
+               <GroupBox Caption="Debug Logger" IsEnabled="{DebugLogIsEnabled}" Height="40%">
+                       <HorizontalStack>
+                               <ListBox Data="{²RecordedEvents}"/>
+                               <VerticalStack Width="50%">
+                                       <EnumSelector RadioButtonStyle="CheckBox2" Template="#CECrowPlugin.ui.EnumSelector.template" Width="Stretched"
+                                               Caption="Recorded Events" EnumValue="{²AddRecordedEvents}"  />
+                                       <HorizontalStack>
+                                               <Button/>
+                                       </HorizontalStack>
+                               </VerticalStack>
+                                       
+                               <!--<HorizontalStack Height="Fit"> BitFieldExcludeMask="255"
                                        <CheckBox Caption="Recording" IsChecked="{²Recording}" Height="24" Width="30"
                                                Checked="{sh.Path='A 8,8,7.5,0,6.3 O 0.8,0,0,1 f O 0,0,0,0.5 G'}"
                                                Unchecked="{sh.Path='R 0.5,0.5,15,15 f O 0,0,0,1 G'}">
@@ -51,7 +56,7 @@
                                                </ItemTemplate>
                                        </Menu>
                                </HorizontalStack>-->
-                       </VerticalStack>
+                       </HorizontalStack>
                </GroupBox>
        </VerticalStack>
 </DockWindow>
index c46730642a83dc3142bffb8c6e41a2f8add96d4f..b057d4f8cb2ad2e6c5bdfe85190c1b935e1fc3ca 100644 (file)
@@ -1,13 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
-               <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
+               <TargetFrameworks>net5</TargetFrameworks>
                <EnableDefaultItems>false</EnableDefaultItems>
        </PropertyGroup>
 
        <ItemGroup>
                <Compile Include="src\**\*.cs" />
                <EmbeddedResource Include="ui\**\*.*" />
+               <EmbeddedResource Include="default.conf" />
        </ItemGroup>
        <ItemGroup>
                <ProjectReference Include="../CERoslynPlugin\CERoslynPlugin.csproj" />
diff --git a/plugins/CENetcoreDbgPlugin/default.conf b/plugins/CENetcoreDbgPlugin/default.conf
new file mode 100644 (file)
index 0000000..5ade3b6
--- /dev/null
@@ -0,0 +1 @@
+MainService=NetcoreDbgPlugin.NetcoreDbgService
\ No newline at end of file
index f3a319a5c00991c2f46752c0c77c4e657c703303..12711c8d8863dde2e77fec7cdc0625c6fb4c5326 100644 (file)
@@ -54,16 +54,15 @@ namespace NetcoreDbgPlugin
                        CurrentState = Status.Paused;
                }
 
-               /*public Command CMDOptions_SelectNetcoredbgPath = new Command ("...",
+               public Command CMDOptions_SelectNetcoredbgPath => new ActionCommand ("...",
                        () => {
                                FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
                                        <FileDialog Caption='Select netcoredbg executable path' CurrentDirectory='{NetcoredbgPath}'
-                                                               ShowFiles='true' ShowHidden='true'/>
-                               ");
+                                                               ShowFiles='true' ShowHidden='true'/>");
                                dlg.OkClicked += (sender, e) => NetcoredbgPath = (sender as FileDialog).SelectedFileFullPath;
                                dlg.DataSource = this;
                        }
-               );*/
+               );
 
                public override string ConfigurationWindowPath => "#CENetcoreDbgPlugin.ui.winConfiguration.crow";
        }
index f9805120907f9a76a1c335879a92ab9310cedd0c..b5935f51e3cb070b83e58a2232c5efffd974f193 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<DockWindow Caption="NetcoreDbg plugin configuration"  Width="300" Height="400" Resizable="false">
+<DockWindow Caption="NetcoreDbg plugin configuration"  Width="80%" Height="400" Resizable="false">
        <VerticalStack RootDataLevel="true" Margin="5">
                <HorizontalStack Height="Fit">
                        <Label Width="200" Text="Netcoredbg path"/>
index 4a74b0843b5acba1c8b67a78ece5fd2300a6386c..1efd147f9a1de1263424ac76e7526939364fcb67 100644 (file)
@@ -61,6 +61,14 @@ namespace CERoslynPlugin
                        AssemblyLoadContext pluginCtx = AssemblyLoadContext.GetLoadContext (Assembly.GetExecutingAssembly());
                        pluginCtx.Resolving += msbuildResolve;
 
+                       /*foreach (string dll in Directory.GetFiles ("/usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.17/", "*.dll")) {
+                               try {
+                                       pluginCtx.LoadFromAssemblyPath (dll);
+                               } catch (Exception ex) {
+                                       App.Log(LogType.Error, $"[RoslynService]{ex}");
+                               }
+                       }*/
+
                        foreach (string dll in Directory.GetFiles (MSBuildRoot, "*.dll")) {
                                try {
                                        pluginCtx.LoadFromAssemblyPath (dll);
@@ -68,14 +76,21 @@ namespace CERoslynPlugin
                                        App.Log(LogType.Error, $"[RoslynService]{ex}");
                                }
                        }
-                       string capath = Path.Combine (MSBuildRoot, "Roslyn", "bincore");
+                       string capath = Path.Combine (MSBuildRoot, "Roslyn");
+                       foreach (string dll in Directory.GetFiles (capath, "*.dll")) {
+                               try     {
+                                       pluginCtx.LoadFromAssemblyPath (dll);
+                               } catch (Exception ex) {
+                                       App.Log(LogType.Error, $"[RoslynService]{ex}");
+                               }
+                       }
+                       capath = Path.Combine (MSBuildRoot, "Roslyn", "bincore");
                        foreach (string dll in Directory.GetFiles (capath, "*.dll")) {
                                try     {
                                        pluginCtx.LoadFromAssemblyPath (dll);
                                } catch (Exception ex) {
                                        App.Log(LogType.Error, $"[RoslynService]{ex}");
                                }
-
                        }
                }
                Assembly msbuildResolve (AssemblyLoadContext context, AssemblyName assemblyName) {
index b4e49242e9b9f0be47d8ec12c1689b3b5242dedd..d1e931bd0f5ea40182bd790a5a5404dc734619b7 100644 (file)
@@ -119,10 +119,8 @@ namespace CERoslynPlugin
                                                                "NuGet.Config"));
 
                        projectCollection.SetGlobalProperty ("DefaultItemExcludes", "obj/**/*;bin/**/*");
-                       projectCollection.SetGlobalProperty ("TargetFramework", "netcoreapp3.1");
 
-                       projectCollection.SetGlobalProperty ("SolutionDir", Path.GetDirectoryName (FullPath) + Path.DirectorySeparatorChar);
-                       //projectCollection.SetGlobalProperty ("Configuration", "Debug");
+                       //projectCollection.SetGlobalProperty ("RoslynTargetsPath", Path.Combine(roslynService.MSBuildRoot, "Roslyn"));
 
                        //IDE.ProgressNotify (10);