Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: support projects with namespace but org without replay debugger W-19604488#6579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mshanemc wants to merge43 commits intodevelop
base:develop
Choose a base branch
Loading
fromsm/namespace-bugs-part-2
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
43 commits
Select commitHold shift + click to select a range
b76c34f
chore: inline command registration
mshanemcOct 1, 2025
ef6dda6
refactor: avoid null, simplify returns
mshanemcOct 1, 2025
19b3a6f
refactor: code cleanup
mshanemcOct 1, 2025
98ff0ab
fix: no-namespace org handling for test sidebar and running from editor
mshanemcOct 1, 2025
aded272
refactor: code organization and comments
mshanemcOct 1, 2025
a4aa80d
refactor: remove constructor
mshanemcOct 1, 2025
9eaf796
refactor: tighter types for outcome
mshanemcOct 2, 2025
afc4e16
chore: change default from skip
mshanemcOct 2, 2025
946b1b6
Merge remote-tracking branch 'origin/develop' into sm/namespace-bugs-…
mshanemcOct 2, 2025
0c00f2c
refactor: handle no-org scenario, consolidate the ns work
mshanemcOct 2, 2025
d95b15a
refactor: properly set group status
mshanemcOct 10, 2025
cd91cb7
refactor: regex to string fn
mshanemcOct 13, 2025
19d72eb
fix: restore toggle
mshanemcOct 13, 2025
cbec954
refactor: remove unused exported fns
mshanemcOct 21, 2025
13cb60d
refactor: remove duplicate prechecker
mshanemcOct 21, 2025
88d48b7
refactor: remove unused const/config
mshanemcOct 21, 2025
610ee0e
chore: remove unused type export
mshanemcOct 21, 2025
baa5a5e
chore: empty string handling for error without message
mshanemcOct 21, 2025
0125adc
refactor: simplify checkpoint nodes
mshanemcOct 21, 2025
c09b815
refactor: reduce breakpointUtil
mshanemcOct 21, 2025
82be400
refactor: more functions, fewer classes
mshanemcOct 21, 2025
8d3b1dc
refactor: shared ext activation
mshanemcOct 22, 2025
af15abb
Merge branch 'sm/dead-code-checkpoint-service' into sm/namespace-bugs…
mshanemcOct 22, 2025
29dc08c
refactor: logContextUtils => fn
mshanemcOct 23, 2025
8a4af36
refactor: direct imports
mshanemcOct 23, 2025
7cb054b
refactor: unbarrel
mshanemcOct 23, 2025
2b0cb3d
refactor: remove requestService, use connection
mshanemcOct 23, 2025
4c22808
fix: namespace correction
mshanemcOct 23, 2025
e39914e
refactor: tooling can't do mass create/delete :(
mshanemcOct 23, 2025
98346fc
fix: set breakpoints on anonymous apex
mshanemcOct 23, 2025
d5ce6ac
refactor: pr cleanup
mshanemcOct 23, 2025
49d2b85
chore: readonly and headers
mshanemcOct 23, 2025
c705f91
Merge remote-tracking branch 'origin/develop' into sm/namespace-bugs-…
mshanemcOct 23, 2025
8688059
chore: cleanup
mshanemcOct 23, 2025
ccf9fdc
chore: lockfile
mshanemcOct 23, 2025
b4a1cbb
chore: enum cleanup
mshanemcOct 23, 2025
6250774
chore: i18n
mshanemcOct 23, 2025
47adabf
chore: i18n
mshanemcOct 23, 2025
104f2f9
chore: i18n
mshanemcOct 23, 2025
aba4971
chore: simplify debugConfig
mshanemcOct 23, 2025
8242fc6
chore: put stopOnEntry back the way it was
mshanemcOct 24, 2025
5d5c1d0
refactor: functional style
mshanemcOct 28, 2025
0ed5b93
Merge remote-tracking branch 'origin/develop' into sm/namespace-bugs-…
mshanemcOct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions.cursor/rules/test-your-changes.mdc
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@ description:
globs:
alwaysApply: true
---
when you changes a file, you should run relevant compile, linters then unit tests so that you cna propose valid changes.

don't change both /src and /test unless it's to refactor imports or rename. "real changes" should be one or the other.
when you change a file, run relevant compile, linters then unit tests so that you propose only valid changes.

don't change both /src and /test unless it's to refactor imports or rename. "real changes" should be one or the other.

do not say a test/compile/lint failure was "pre-existing" without running the same operation on a previous version of the code before the current un-pushed commits began.
14 changes: 12 additions & 2 deletions.vscode/launch.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,7 +37,11 @@
],
"sourceMaps": true,
"smartStep": true,
"outFiles": ["${workspaceFolder}/packages/*/out/src/**/*.js"],
"outFiles": [
"${workspaceFolder}/packages/*/out/src/**/*.js",
"${workspaceFolder}/packages/*/out/**/*.js",
"${workspaceFolder}/packages/*/dist/**/*.js"
],
"env": {
"LANGUAGE_SERVER_LOG_LEVEL": "${env:LANGUAGE_SERVER_LOG_LEVEL}",
"SUSPEND_LANGUAGE_SERVER_STARTUP": "${env:SUSPEND_LANGUAGE_SERVER_STARTUP}",
Expand All@@ -48,6 +52,7 @@
"webpack:///salesforcedx-vscode-soql/./*": "${workspaceFolder}/packages/salesforcedx-vscode-soql/*",
"webpack:///salesforcedx-vscode-soql/../salesforcedx-utils-vscode/*": "${workspaceFolder}/packages/salesforcedx-utils-vscode/*",
"webpack:///salesforcedx-sobjects-faux-generator/./*": "${workspaceFolder}/packages/salesforcedx-sobjects-faux-generator/*",
"webpack:///salesforcedx-vscode-apex-replay-debugger/./*": "${workspaceFolder}/packages/salesforcedx-vscode-apex-replay-debugger/src/*",
"webpack:///*": "*"
},
"preLaunchTask": "Compile"
Expand All@@ -71,7 +76,11 @@
"stopOnEntry": false,
"sourceMaps": true,
"smartStep": true,
"outFiles": ["${workspaceFolder}/packages/*/out/src/**/*.js"],
"outFiles": [
"${workspaceFolder}/packages/*/out/src/**/*.js",
"${workspaceFolder}/packages/*/out/**/*.js",
"${workspaceFolder}/packages/*/dist/**/*.js"
],
"env": {
"LANGUAGE_SERVER_LOG_LEVEL": "${env:LANGUAGE_SERVER_LOG_LEVEL}",
"SUSPEND_LANGUAGE_SERVER_STARTUP": "${env:SUSPEND_LANGUAGE_SERVER_STARTUP}",
Expand All@@ -82,6 +91,7 @@
"webpack:///salesforcedx-vscode-soql/./*": "${workspaceFolder}/packages/salesforcedx-vscode-soql/*",
"webpack:///salesforcedx-vscode-soql/../salesforcedx-utils-vscode/*": "${workspaceFolder}/packages/salesforcedx-utils-vscode/*",
"webpack:///salesforcedx-sobjects-faux-generator/./*": "${workspaceFolder}/packages/salesforcedx-sobjects-faux-generator/*",
"webpack:///salesforcedx-vscode-apex-replay-debugger/./*": "${workspaceFolder}/packages/salesforcedx-vscode-apex-replay-debugger/src/*",
"webpack:///*": "*"
}
},
Expand Down
27 changes: 14 additions & 13 deletionspackage-lock.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

3 changes: 2 additions & 1 deletionpackages/salesforcedx-apex-replay-debugger/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,8 @@
"@salesforce/salesforcedx-utils": "65.2.0",
"@vscode/debugadapter": "1.68.0",
"@vscode/debugprotocol": "1.68.0",
"vscode-uri": "^3.1.0"
"vscode-uri": "^3.1.0",
"@salesforce/core": "^8.23.3"
},
"devDependencies": {
"@salesforce/vscode-service-provider": "^1.5.0",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@ import {
} from '@vscode/debugadapter';
import { DebugProtocol } from '@vscode/debugprotocol';
import { EOL } from 'node:os';
import { breakpointUtil} from '../breakpoints';
import { breakpointUtil, returnLinesForLoggingFromBreakpointArgs} from '../breakpoints/breakpointUtil';
import { SEND_METRIC_GENERAL_EVENT, SEND_METRIC_ERROR_EVENT, SEND_METRIC_LAUNCH_EVENT } from '../constants';
import { HeapDumpService } from '../core/heapDumpService';
import { LogContext } from '../core/logContext';
Expand DownExpand Up@@ -159,11 +159,7 @@ export class ApexReplayDebug extends LoggingDebugSession {
this.trace = args.trace.split(',').map(category => category.trim());
this.traceAll = this.trace.includes(TRACE_ALL);
}
if (this.trace?.indexOf(TRACE_CATEGORY_PROTOCOL) >= 0) {
logger.setup(Logger.LogLevel.Verbose, false);
} else {
logger.setup(Logger.LogLevel.Stop, false);
}
logger.setup(this.trace.includes(TRACE_CATEGORY_PROTOCOL) ? Logger.LogLevel.Verbose : Logger.LogLevel.Stop, false);
}

public configurationDoneRequest(
Expand DownExpand Up@@ -385,7 +381,7 @@ export class ApexReplayDebug extends LoggingDebugSession {
TRACE_CATEGORY_BREAKPOINTS,
`setBreakPointsRequest: path=${
args.source.path
} uri=${uri} lines=${breakpointUtil.returnLinesForLoggingFromBreakpointArgs(args.breakpoints)}`
} uri=${uri} lines=${returnLinesForLoggingFromBreakpointArgs(args.breakpoints)}`
);
this.breakpoints.set(uri, []);
for (const bp of args.breakpoints) {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { LineBreakpointInfo } from '@salesforce/salesforcedx-utils';
import { DebugProtocol } from '@vscode/debugprotocol';

export type TraceCategory = 'all' | 'protocol' | 'logfile' | 'launch' | 'breakpoints';
Expand All@@ -14,8 +15,8 @@ export type LaunchRequestArguments = DebugProtocol.LaunchRequestArguments & {
logFileContents: string; // File contents (for web compatibility)
logFilePath: string;
logFileName: string;
stopOnEntry?: boolean | true;
stopOnEntry?: boolean;
trace?: boolean | string;
lineBreakpointInfo?:import('@salesforce/salesforcedx-utils').LineBreakpointInfo[];
lineBreakpointInfo?: LineBreakpointInfo[];
projectPath: string | undefined;
};
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,32 +9,11 @@ import { LineBreakpointInfo } from '@salesforce/salesforcedx-utils';
import { DebugProtocol } from '@vscode/debugprotocol';

export class BreakpointUtil {
private static instance: BreakpointUtil;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

a bunch of this was either completely unused or used only for testing.

exposing the 2 maps simplifies things a lot

private lineNumberMapping: Map<string, number[]> = new Map();
private typerefMapping: Map<string, string> = new Map();

public setValidLines(lineNumberMapping: Map<string, number[]>, typerefMapping: Map<string, string>): void {
this.lineNumberMapping = lineNumberMapping;
this.typerefMapping = typerefMapping;
}

public static getInstance(): BreakpointUtil {
if (!BreakpointUtil.instance) {
BreakpointUtil.instance = new BreakpointUtil();
}
return BreakpointUtil.instance;
}

public getLineNumberMapping(): Map<string, number[]> {
return this.lineNumberMapping;
}

public getTyperefMapping(): Map<string, string> {
return this.typerefMapping;
}
public lineNumberMapping: Map<string, number[]> = new Map();
public typerefMapping: Map<string, string> = new Map();

public canSetLineBreakpoint(uri: string, line: number): boolean {
return this.lineNumberMapping.has(uri) && this.lineNumberMapping.get(uri)!.includes(line);
return this.lineNumberMapping.get(uri)?.includes(line) ?? false;
}

public createMappingsFromLineBreakpointInfo(lineBpInfo: LineBreakpointInfo[]): void {
Expand All@@ -43,28 +22,18 @@ export class BreakpointUtil {
this.typerefMapping.clear();

// set the mapping from the source line info
for (const info of lineBpInfo) {
if (!this.lineNumberMapping.has(info.uri)) {
this.lineNumberMapping.set(info.uri, []);
}
this.lineNumberMapping.set(info.uri, this.lineNumberMapping.get(info.uri)!.concat(info.lines));
lineBpInfo.map(info => {
this.lineNumberMapping.set(info.uri, (this.lineNumberMapping.get(info.uri) ?? []).concat(info.lines));
this.typerefMapping.set(info.typeref, info.uri);
}
});
}

public returnLinesForLoggingFromBreakpointArgs(bpArr: DebugProtocol.SourceBreakpoint[]): string {
return bpArr.map(bp => bp.line).join(',');
}

public getTopLevelTyperefForUri(uriInput: string): string {
let returnValue = '';
this.typerefMapping.forEach((value, key) => {
if (value === uriInput) {
if (!key.includes('$')) {
returnValue = key;
}
}
});
return returnValue;
public getTopLevelTyperefForUri(uriInput: string): string | undefined {
return Array.from(this.typerefMapping.entries()).find(([k, v]) => v === uriInput && !k.includes('$'))?.[0];
}
}

export const breakpointUtil = new BreakpointUtil();
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

you can instantiate a class and export that instance instead of doing all the singleon pattern getInstance boilerplate


export const returnLinesForLoggingFromBreakpointArgs = (bpArr: DebugProtocol.SourceBreakpoint[]): string =>
bpArr.map(bp => bp.line).join(',');
View file
Open in desktop

This file was deleted.

View file
Open in desktop

This file was deleted.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,6 @@ export const CHECKPOINTS_LOCK_STRING = 'checkpoints_lock';
export const DEBUGGER_LAUNCH_TYPE = 'launch';
export const DEBUGGER_TYPE = 'apex-replay';
export const LIVESHARE_DEBUGGER_TYPE = 'vslsShare';
export const FIELD_INTEGRITY_EXCEPTION = 'FIELD_INTEGRITY_EXCEPTION';
export const SEND_METRIC_GENERAL_EVENT = 'sendMetricGeneral';
export const SEND_METRIC_ERROR_EVENT = 'sendMetricError';
export const LAST_OPENED_LOG_FOLDER_KEY = 'LAST_OPENED_LOG_FOLDER_KEY';
Expand Down
44 changes: 10 additions & 34 deletionspackages/salesforcedx-apex-replay-debugger/src/core/heapDump.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,39 +4,15 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import {ApexExecutionOverlayResultCommandSuccess } from '../commands';
import {ApexExecutionOverlayResult } from '../types/apexExecutionOverlayResultCommand';

export class ApexHeapDump {
private readonly heapDumpId: string;
private readonly className: string;
private readonly namespace: string;
private readonly line: number;
private overlaySuccessResut: ApexExecutionOverlayResultCommandSuccess | undefined;
constructor(heapDumpId: string, className: string, namespace: string, line: number) {
this.heapDumpId = heapDumpId;
this.className = className;
this.namespace = namespace;
this.line = line;
}
public getHeapDumpId(): string {
return this.heapDumpId;
}
public getClassName(): string {
return this.className;
}
public getNamespace(): string {
return this.namespace;
}
public getLine(): number {
return this.line;
}
public getOverlaySuccessResult(): ApexExecutionOverlayResultCommandSuccess | undefined {
return this.overlaySuccessResut;
}
public setOverlaySuccessResult(overlaySuccessResult: ApexExecutionOverlayResultCommandSuccess): void {
this.overlaySuccessResut = overlaySuccessResult;
}
export type ApexHeapDump = {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

you don't need a class just to make some immutable props.
if you see a getter/setter on the same prop, without any fancy mutation, that's just a public mutable property wasted code

readonly className: string;
readonly namespace: string;
readonly line: number;
readonly heapDumpId: string;
overlaySuccessResult?: ApexExecutionOverlayResult;
};

public toString = (): string =>
`HeapDumpId: ${this.heapDumpId}, ClassName: ${this.className}, Namespace: ${this.namespace}, Line: ${this.line}`;
}
export const stringifyHeapDump = (heapDump: ApexHeapDump): string =>
`HeapDumpId: ${heapDump.heapDumpId}, ClassName: ${heapDump.className}, Namespace: ${heapDump.namespace}, Line: ${heapDump.line}`;
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp