Class: DSP::Source

Inherits:
DSPBase show all
Defined in:
lib/dsp/dsp_protocol.rb

Overview

interface Source {

    /** The short name of the source. Every source returned from the debug adapter has a name.
        When sending a source to the debug adapter this name is optional.
    */
    name?: string;
    /** The path of the source to be shown in the UI.
        It is only used to locate and load the content of the source if no sourceReference is specified (or its value is 0).
    */
    path?: string;
    /** If sourceReference > 0 the contents of the source must be retrieved through the SourceRequest (even if a path is specified).
        A sourceReference is only valid for a session, so it must not be used to persist a source.
        The value should be less than or equal to 2147483647 (2^31 - 1).
    */
    sourceReference?: number;
    /** An optional hint for how to present the source in the UI.
        A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping.
    */
    presentationHint?: 'normal' | 'emphasize' | 'deemphasize';
    /** The (optional) origin of this source: possible values 'internal module', 'inlined content from source map', etc. */
    origin?: string;
    /** An optional list of sources that are related to this source. These may be the source that generated this source. */
    sources?: Source[];
    /** Optional data that a debug adapter might want to loop through the client.
        The client should leave the data intact and persist it across sessions. The client should not interpret the data.
    */
    adapterData?: any;
    /** The checksums associated with this file. */
    checksums?: Checksum[];
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ Source

Returns a new instance of Source.



3908
3909
3910
3911
# File 'lib/dsp/dsp_protocol.rb', line 3908

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[name path sourceReference presentationHint origin sources adapterData checksums]
end

Instance Attribute Details

#adapterDataObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def adapterData
  @adapterData
end

#checksumsObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def checksums
  @checksums
end

#nameObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def name
  @name
end

#originObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def origin
  @origin
end

#pathObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def path
  @path
end

#presentationHintObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def presentationHint
  @presentationHint
end

#sourceReferenceObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def sourceReference
  @sourceReference
end

#sourcesObject

type: string # type: string # type: number # type: string with value ‘normal’ | ‘emphasize’ | ‘deemphasize’ # type: string # type: Source[] # type: any # type: Checksum[]



3906
3907
3908
# File 'lib/dsp/dsp_protocol.rb', line 3906

def sources
  @sources
end

Instance Method Details

#from_h!(value) ⇒ Object



3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
# File 'lib/dsp/dsp_protocol.rb', line 3913

def from_h!(value)
  value = {} if value.nil?
  self.name = value['name']
  self.path = value['path']
  self.sourceReference = value['sourceReference']
  self.presentationHint = value['presentationHint'] # Unknown type
  self.origin = value['origin']
  self.sources = to_typed_aray(value['sources'], Source)
  self.adapterData = value['adapterData']
  self.checksums = to_typed_aray(value['checksums'], Checksum)
  self
end