MCPcopy
hub / github.com/microsoft/vscode-js-debug / _getPreferredUILocation

Method _getPreferredUILocation

src/adapter/debugAdapter.ts:139–174  ·  view source on GitHub ↗
(
    params: Dap.GetPreferredUILocationParams,
  )

Source from the content-addressed store, hash-verified

137 }
138
139 private async _getPreferredUILocation(
140 params: Dap.GetPreferredUILocationParams,
141 ): Promise<Dap.GetPreferredUILocationResult> {
142 let source: Source | undefined = undefined;
143 if (params.originalUrl) {
144 source = this.sourceContainer.getSourceByOriginalUrl(params.originalUrl);
145 }
146 if (!source && params.source) {
147 source = this.sourceContainer.source(params.source);
148 }
149
150 if (!source) {
151 if (params.source) {
152 // Return unmodified input source
153 return {
154 column: params.column,
155 line: params.line,
156 source: params.source,
157 };
158 } else {
159 throw new ProtocolError(errors.missingSourceInformation());
160 }
161 }
162
163 const location = await this.sourceContainer.preferredUiLocation({
164 columnNumber: params.column + 1,
165 lineNumber: params.line + 1,
166 source,
167 });
168
169 return {
170 column: location.columnNumber - 1,
171 line: location.lineNumber - 1,
172 source: await location.source.toDap(),
173 };
174 }
175
176 private async _doNetworkCall({ method, params }: Dap.NetworkCallParams) {
177 if (!this._thread) {

Callers 1

constructorMethod · 0.95

Calls 4

preferredUiLocationMethod · 0.80
sourceMethod · 0.65
toDapMethod · 0.65

Tested by

no test coverage detected