<commit_before>﻿using Microsoft.PowerShell.EditorServices.Session;
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Event;
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Response;
using Nito.AsyncEx;
using System.Threading.Tasks;

namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Request
{
    [MessageTypeName("initialize")]
    public class InitializeRequest : RequestBase<InitializeRequestArguments>
    {
        public override async Task ProcessMessage(
            EditorSession editorSession, 
            MessageWriter messageWriter)
        {
            // Send the Initialized event first so that we get breakpoints
            await messageWriter.WriteMessage(
                new InitializedEvent());

            // Now send the Initialize response to continue setup
            await messageWriter.WriteMessage(
                this.PrepareResponse(
                    new InitializeResponse()));
        }
    }

    public class InitializeRequestArguments
    {<commit_msg>Add separate log file for debugging service<commit_after>﻿using Microsoft.PowerShell.EditorServices.Session;
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Event;
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Message;
using Microsoft.PowerShell.EditorServices.Transport.Stdio.Response;
using Microsoft.PowerShell.EditorServices.Utility;
using Nito.AsyncEx;
using System.Threading.Tasks;

namespace Microsoft.PowerShell.EditorServices.Transport.Stdio.Request
{
    [MessageTypeName("initialize")]
    public class InitializeRequest : RequestBase<InitializeRequestArguments>
    {
        public override async Task ProcessMessage(
            EditorSession editorSession, 
            MessageWriter messageWriter)
        {
            // TODO: Remove this behavior in the near future --
            //   Create the debug service log in a separate file
            //   so that there isn't a conflict with the default 
            //   log file.
            Logger.Initialize("DebugService.log", LogLevel.Verbose);

            // Send the Initialized event first so that we get breakpoints
            await messageWriter.WriteMessage(
                new InitializedEvent());

            // Now send the Initialize response to continue setup
            await messageWriter.WriteMessage(
                this.PrepareResponse(
                    new InitializeResponse()));
        }
    }

    public class InitializeRequestArguments
    {
{'fraction_non_alphanumeric': 0.06726632772780602, 'fraction_numerical': 0.0, 'mean_word_length': 2.767304860088365, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5662236', 'n_tokens_mistral': 574, 'n_tokens_neox': 571, 'n_words': 154}