<commit_before># Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

function Set-ScriptExtent {
    <#
    .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
    #>
    [CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='__AllParameterSets')]
    param(
        [Parameter(Position=0, Mandatory)]
        [psobject]
        $Text,

        [Parameter(Mandatory, ParameterSetName='AsString')]
        [switch]
        $AsString,

        [Parameter(Mandatory, ParameterSetName='AsArray')]
        [switch]
        $AsArray,

        [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
        [System.Management.Automation.Language.IScriptExtent]
        $Extent = (Find-Ast -AtCursor).Extent
    )
    begin {
        $fileContext = $psEditor.GetEditorContext().CurrentFile
        $extentList = [System.Collections.Generic.List[Microsoft.PowerShell.EditorServices.Extensions.FileScriptExtent, Microsoft.PowerShell.EditorServices]]::new()<commit_msg>Fix type resolution error in `Set-ScriptExtent`<commit_after># Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

function Set-ScriptExtent {
    <#
    .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
    #>
    [CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='__AllParameterSets')]
    param(
        [Parameter(Position=0, Mandatory)]
        [psobject]
        $Text,

        [Parameter(Mandatory, ParameterSetName='AsString')]
        [switch]
        $AsString,

        [Parameter(Mandatory, ParameterSetName='AsArray')]
        [switch]
        $AsArray,

        [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
        [System.Management.Automation.Language.IScriptExtent]
        $Extent = (Find-Ast -AtCursor).Extent
    )
    begin {
        $fileContext = $psEditor.GetEditorContext().CurrentFile
        $extentList = [System.Collections.Generic.List[[Microsoft.PowerShell.EditorServices.Extensions.FileScriptExtent, Microsoft.PowerShell.EditorServices]]]::new()
{'fraction_non_alphanumeric': 0.11376953125, 'fraction_numerical': 0.0009765625, 'mean_word_length': 3.56347438752784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1565729', 'n_tokens_mistral': 583, 'n_tokens_neox': 580, 'n_words': 86}