agent-docs 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLAN.md +8 -8
- package/README.md +44 -43
- package/docs/CODEANALYZER.md +85 -0
- package/docs/REVENUETRANSACTIONMANAGEMENT.md +12 -8
- package/package.json +1 -1
- package/postinstall.mjs +22 -11
- package/docs/VSCODE.md +0 -231
package/PLAN.md
CHANGED
|
@@ -49,8 +49,8 @@ The README.md should contain:
|
|
|
49
49
|
- Instructions for adding the package to a project (as a dependency or
|
|
50
50
|
submodule)
|
|
51
51
|
- Explanation of the automatic `postinstall` behavior:
|
|
52
|
-
- When
|
|
53
|
-
|
|
52
|
+
- When `agent-docs` is installed into another project, a `postinstall`
|
|
53
|
+
script will run in the consuming project.
|
|
54
54
|
- If the consuming project does **not** already have a `docs/`
|
|
55
55
|
directory, the script will create a single symlink/junction from the
|
|
56
56
|
consuming project's `docs/` directory to this package's `docs/`
|
|
@@ -369,9 +369,9 @@ Add any other context, examples, or screenshots about the feature request here.
|
|
|
369
369
|
### `postinstall.mjs`
|
|
370
370
|
|
|
371
371
|
The postinstall script that runs when this package is installed in another
|
|
372
|
-
project. It should
|
|
373
|
-
|
|
374
|
-
|
|
372
|
+
project. It should copy this package's `docs/` directory to the consuming
|
|
373
|
+
project's root directory, but only if the consuming project doesn't already have
|
|
374
|
+
a `docs/` directory.
|
|
375
375
|
|
|
376
376
|
```js
|
|
377
377
|
// postinstall.mjs
|
|
@@ -608,7 +608,7 @@ Standard MIT license with copyright holder: starch-uk
|
|
|
608
608
|
|
|
609
609
|
### package.json
|
|
610
610
|
|
|
611
|
-
- Name:
|
|
611
|
+
- Name: `agent-docs`
|
|
612
612
|
- Type: module
|
|
613
613
|
- Version: `1.0.0`
|
|
614
614
|
- Scripts: `format`, `format:fix`, `format:check`, `postinstall`
|
|
@@ -650,8 +650,8 @@ The plan should:
|
|
|
650
650
|
GRAPHENGINE.md, GRAPHML.md, GRAPHSON.md, GREMLIN.md, GRYO.md, HUSKY.md,
|
|
651
651
|
JEST30.md, JORJE.md, JSDOC.md, PMD.md, PMDAPEXAST.md, PMDSUPPRESSWARNINGS.md,
|
|
652
652
|
PNPM.md, PRETTIER.md, PRETTIERAPEX.md, REGEX.md, RETIREJS.md, SFCLI.md,
|
|
653
|
-
TINKERPOP.md, VITEST.md,
|
|
654
|
-
|
|
653
|
+
TINKERPOP.md, VITEST.md, XPATH31.md) need to be initialized with version
|
|
654
|
+
`1.0.0` (or appropriate version based on their current state) when the
|
|
655
655
|
versioning system is first implemented. These existing docs will be tracked
|
|
656
656
|
going forward using the same semver system.
|
|
657
657
|
- Describe how scripts can help with versioning by:
|
package/README.md
CHANGED
|
@@ -40,26 +40,24 @@ with any technology.
|
|
|
40
40
|
2. **Add to your project:**
|
|
41
41
|
|
|
42
42
|
You can add agent-docs to your project in several ways:
|
|
43
|
-
- **As an npm dependency (recommended):**
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
- **As an npm dependency (recommended):** Add `agent-docs` to your
|
|
44
|
+
`package.json` and install with your package manager (e.g. `pnpm install`,
|
|
45
|
+
`npm install`, or `yarn add`).
|
|
46
46
|
|
|
47
47
|
When installed this way, a `postinstall` script runs in the consuming
|
|
48
48
|
project:
|
|
49
49
|
- If your project does **not** already have a `docs/` directory, the
|
|
50
|
-
script will
|
|
51
|
-
|
|
52
|
-
- On Unix/macOS, a directory symlink is created
|
|
53
|
-
- On Windows, a junction is created
|
|
50
|
+
script will copy this package's `docs/` directory to your project's
|
|
51
|
+
root directory
|
|
54
52
|
- If your project **already has** a `docs/` directory, the script does
|
|
55
53
|
nothing, and your existing docs layout is left unchanged.
|
|
56
54
|
|
|
57
55
|
- **As a git submodule:**
|
|
58
56
|
`git submodule add https://github.com/starch-uk/agent-docs.git`
|
|
59
57
|
|
|
60
|
-
- **As a manual
|
|
61
|
-
-
|
|
62
|
-
|
|
58
|
+
- **As a manual copy (if you want explicit control):**
|
|
59
|
+
- Copy the `docs/` directory from the agent-docs package to your project
|
|
60
|
+
root
|
|
63
61
|
|
|
64
62
|
3. **Configure your IDE agent:**
|
|
65
63
|
|
|
@@ -78,39 +76,42 @@ with any technology.
|
|
|
78
76
|
The `docs/` directory contains generated documentation files. Each doc follows a
|
|
79
77
|
structured format optimized for AI agent consumption:
|
|
80
78
|
|
|
81
|
-
- **APEXANNOTATIONS.md** - Apex annotations reference
|
|
82
|
-
- **APEXDOC.md** - ApexDoc documentation tool reference
|
|
83
|
-
- **CML.md** - Constraint Modeling Language (CML) reference for
|
|
84
|
-
Revenue Cloud Product Configurator
|
|
85
|
-
- **CODEANALYZER.md** - Salesforce Code Analyzer
|
|
86
|
-
Commands, CPD Engine, Flow Scanner Engine, Regex
|
|
87
|
-
MCP tools)
|
|
88
|
-
- **CONTEXTDEFINITIONS.md** - Salesforce Context
|
|
89
|
-
Dynamic Revenue Orchestrator (DRO)
|
|
90
|
-
- **ESLINT.md** - ESLint configuration and rules reference
|
|
91
|
-
- **ESLINTJSDOC.md** - ESLint JSDoc plugin reference
|
|
92
|
-
- **FIELDSERVICE.md** - Salesforce Field Service
|
|
93
|
-
|
|
94
|
-
- **
|
|
95
|
-
- **
|
|
96
|
-
- **
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
99
|
-
- **
|
|
100
|
-
- **
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
103
|
-
- **
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- **
|
|
107
|
-
- **
|
|
108
|
-
- **
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- **
|
|
112
|
-
|
|
113
|
-
- **
|
|
79
|
+
- **[APEXANNOTATIONS.md](docs/APEXANNOTATIONS.md)** - Apex annotations reference
|
|
80
|
+
- **[APEXDOC.md](docs/APEXDOC.md)** - ApexDoc documentation tool reference
|
|
81
|
+
- **[CML.md](docs/CML.md)** - Constraint Modeling Language (CML) reference for
|
|
82
|
+
Salesforce Revenue Cloud Product Configurator
|
|
83
|
+
- **[CODEANALYZER.md](docs/CODEANALYZER.md)** - Salesforce Code Analyzer
|
|
84
|
+
configuration (includes CLI Commands, CPD Engine, Flow Scanner Engine, Regex
|
|
85
|
+
Engine, RetireJS Engine, and MCP tools)
|
|
86
|
+
- **[CONTEXTDEFINITIONS.md](docs/CONTEXTDEFINITIONS.md)** - Salesforce Context
|
|
87
|
+
Definitions reference for Dynamic Revenue Orchestrator (DRO)
|
|
88
|
+
- **[ESLINT.md](docs/ESLINT.md)** - ESLint configuration and rules reference
|
|
89
|
+
- **[ESLINTJSDOC.md](docs/ESLINTJSDOC.md)** - ESLint JSDoc plugin reference
|
|
90
|
+
- **[FIELDSERVICE.md](docs/FIELDSERVICE.md)** - Salesforce Field Service
|
|
91
|
+
reference
|
|
92
|
+
- **[GRAPHBINARY.md](docs/GRAPHBINARY.md)** - Graph Binary format reference
|
|
93
|
+
- **[GRAPHENGINE.md](docs/GRAPHENGINE.md)** - Graph Engine reference
|
|
94
|
+
- **[GRAPHML.md](docs/GRAPHML.md)** - GraphML format reference
|
|
95
|
+
- **[GRAPHSON.md](docs/GRAPHSON.md)** - GraphSON format reference
|
|
96
|
+
- **[GREMLIN.md](docs/GREMLIN.md)** - Gremlin query language reference
|
|
97
|
+
- **[GRYO.md](docs/GRYO.md)** - Gryo binary format reference
|
|
98
|
+
- **[HUSKY.md](docs/HUSKY.md)** - Husky git hooks tool reference
|
|
99
|
+
- **[JEST.md](docs/JEST.md)** - Jest testing framework reference
|
|
100
|
+
- **[JORJE.md](docs/JORJE.md)** - Jorje Apex parser reference
|
|
101
|
+
- **[JSDOC.md](docs/JSDOC.md)** - JSDoc documentation generator reference
|
|
102
|
+
- **[PMD.md](docs/PMD.md)** - PMD static analysis tool reference (includes Apex
|
|
103
|
+
AST reference and suppressing warnings)
|
|
104
|
+
- **[PNPM.md](docs/PNPM.md)** - pnpm package manager reference
|
|
105
|
+
- **[PRETTIER.md](docs/PRETTIER.md)** - Prettier code formatter reference
|
|
106
|
+
- **[PRETTIERAPEX.md](docs/PRETTIERAPEX.md)** - Prettier Apex plugin reference
|
|
107
|
+
- **[REVENUETRANSACTIONMANAGEMENT.md](docs/REVENUETRANSACTIONMANAGEMENT.md)** -
|
|
108
|
+
Salesforce Revenue Cloud Transaction Management reference
|
|
109
|
+
- **[TINKERPOP.md](docs/TINKERPOP.md)** - Apache TinkerPop graph computing
|
|
110
|
+
framework reference
|
|
111
|
+
- **[VITEST.md](docs/VITEST.md)** - Vitest testing framework reference
|
|
112
|
+
- **[CODEANALYZER.md#vs-code-integration](docs/CODEANALYZER.md#vs-code-integration)** -
|
|
113
|
+
VS Code editor integration
|
|
114
|
+
- **[XPATH31.md](docs/XPATH31.md)** - XPath 3.1 query language reference
|
|
114
115
|
|
|
115
116
|
## Contributing
|
|
116
117
|
|
package/docs/CODEANALYZER.md
CHANGED
|
@@ -308,6 +308,91 @@ Requires network
|
|
|
308
308
|
|
|
309
309
|
---
|
|
310
310
|
|
|
311
|
+
## VS Code Integration
|
|
312
|
+
|
|
313
|
+
> **Version**: 1.0.0
|
|
314
|
+
|
|
315
|
+
Salesforce Code Analyzer Visual Studio Code Extension provides real-time
|
|
316
|
+
feedback and code scanning during development.
|
|
317
|
+
|
|
318
|
+
**Reference**:
|
|
319
|
+
[Use the VS Code Extension to Analyze Your Code](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/analyze-vscode.html)
|
|
320
|
+
|
|
321
|
+
### Prerequisites
|
|
322
|
+
|
|
323
|
+
- Visual Studio Code installed
|
|
324
|
+
- Salesforce CLI installed and configured
|
|
325
|
+
- Salesforce Extensions for VS Code installed
|
|
326
|
+
|
|
327
|
+
### Installation
|
|
328
|
+
|
|
329
|
+
**Step 1: Install Salesforce CLI**
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
sf --version
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Step 2: Install Salesforce Extensions for VS Code**
|
|
336
|
+
|
|
337
|
+
Extension pack includes Code Analyzer: Search "Salesforce Extension Pack" in VS
|
|
338
|
+
Code Extensions.
|
|
339
|
+
|
|
340
|
+
**Step 3: Install Code Analyzer CLI Plugin**
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
sf plugins install @salesforce/sfdx-scanner
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Verify: `sf scanner --help`
|
|
347
|
+
|
|
348
|
+
### Scanning Commands
|
|
349
|
+
|
|
350
|
+
| Command | Description | Access |
|
|
351
|
+
| ----------------------------- | ------------------------ | ------------------------------ |
|
|
352
|
+
| **SFDX: Scan Current File** | Analyze active file | Command Palette (Ctrl+Shift+P) |
|
|
353
|
+
| **SFDX: Scan Selected Files** | Analyze selection | Right-click Explorer |
|
|
354
|
+
| **SFDX: Scan Workspace** | Analyze entire workspace | Command Palette |
|
|
355
|
+
|
|
356
|
+
### Results Display
|
|
357
|
+
|
|
358
|
+
**Problems Panel** (Ctrl+Shift+M): Severity icons, file navigation, rule details
|
|
359
|
+
|
|
360
|
+
**Inline Annotations**: Red/Yellow/Blue squiggles by severity level
|
|
361
|
+
|
|
362
|
+
**Quick Actions**: Go to definition, view rule details, copy violation
|
|
363
|
+
|
|
364
|
+
### Configuration
|
|
365
|
+
|
|
366
|
+
**Extension Settings** (VS Code Settings → "Salesforce Code Analyzer"):
|
|
367
|
+
|
|
368
|
+
- Enable/Disable extension
|
|
369
|
+
- Auto-scan on save
|
|
370
|
+
- Default engine selection
|
|
371
|
+
- Severity mapping to VS Code levels
|
|
372
|
+
- Excluded file patterns
|
|
373
|
+
|
|
374
|
+
**Project Config**: Respects `code-analyzer.yml` in project root
|
|
375
|
+
|
|
376
|
+
### Troubleshooting
|
|
377
|
+
|
|
378
|
+
| Issue | Solution |
|
|
379
|
+
| ------------------------- | --------------------------------------------------------------- |
|
|
380
|
+
| **Extension not working** | Verify CLI/plugin installed, check Output panel, reload VS Code |
|
|
381
|
+
| **No results** | Check file types supported, verify config, review Output panel |
|
|
382
|
+
| **Slow performance** | Exclude patterns, disable auto-scan, scan selectively |
|
|
383
|
+
| **Plugin not found** | Reinstall plugin, check CLI compatibility, restart VS Code |
|
|
384
|
+
|
|
385
|
+
### Best Practices
|
|
386
|
+
|
|
387
|
+
1. Customize `code-analyzer.yml` for team standards
|
|
388
|
+
2. Scan regularly during development
|
|
389
|
+
3. Prioritize High/Critical severity fixes
|
|
390
|
+
4. Use rule tags ("Recommended") for focus
|
|
391
|
+
5. Understand rule rationale before fixing
|
|
392
|
+
6. Exclude generated/third-party code
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
311
396
|
## CI/CD Integration
|
|
312
397
|
|
|
313
398
|
### GitHub Actions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Salesforce Revenue Cloud: Transaction Management
|
|
2
2
|
|
|
3
|
-
> v1.0.
|
|
3
|
+
> v1.0.1 | Editions: Enterprise, Unlimited, Developer (Lightning Experience)
|
|
4
4
|
|
|
5
5
|
## Quick Reference
|
|
6
6
|
|
|
@@ -559,13 +559,17 @@ Contains information about asset create/update from
|
|
|
559
559
|
**Important:** Included in `CreateAssetOrderEvent` message; cannot subscribe
|
|
560
560
|
directly.
|
|
561
561
|
|
|
562
|
-
**Fields:**
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
562
|
+
**Fields:**
|
|
563
|
+
|
|
564
|
+
| Field | Type | Description |
|
|
565
|
+
| -------------- | --------- | ----------------------------------------------- |
|
|
566
|
+
| `AssetId` | Reference | Created/updated asset ID (nillable) |
|
|
567
|
+
| `ErrorCode` | String | Error type reference code (nillable) |
|
|
568
|
+
| `ErrorMessage` | String | Error information (nillable) |
|
|
569
|
+
| `EventUuid` | String | Platform event message UUID (nillable) |
|
|
570
|
+
| `IsSuccess` | Boolean | Request success status (default: false, v61.0+) |
|
|
571
|
+
| `OrderItemId` | Reference | Order item ID used in request (v61.0+) |
|
|
572
|
+
| `ReplayId` | String | Event stream position (nillable) |
|
|
569
573
|
|
|
570
574
|
**Supported Subscribers:** Apex Triggers, Flows, Processes, Pub/Sub API,
|
|
571
575
|
Streaming API (CometD)
|
package/package.json
CHANGED
package/postinstall.mjs
CHANGED
|
@@ -17,6 +17,21 @@ const packageDocsDir = path.join(packageRoot, 'docs');
|
|
|
17
17
|
// The docs directory in the consumer project
|
|
18
18
|
const consumerDocsDir = path.join(consumerRoot, 'docs');
|
|
19
19
|
|
|
20
|
+
async function copyDirRecursive(src, dest) {
|
|
21
|
+
const stats = await fs.promises.stat(src);
|
|
22
|
+
if (stats.isDirectory()) {
|
|
23
|
+
await fs.promises.mkdir(dest, { recursive: true });
|
|
24
|
+
const entries = await fs.promises.readdir(src);
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
const srcPath = path.join(src, entry);
|
|
27
|
+
const destPath = path.join(dest, entry);
|
|
28
|
+
await copyDirRecursive(srcPath, destPath);
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
await fs.promises.copyFile(src, dest);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
20
35
|
async function main() {
|
|
21
36
|
try {
|
|
22
37
|
// Ensure this package actually has a docs directory
|
|
@@ -31,18 +46,14 @@ async function main() {
|
|
|
31
46
|
return;
|
|
32
47
|
}
|
|
33
48
|
|
|
34
|
-
|
|
49
|
+
// Copy the docs directory instead of creating symlinks
|
|
50
|
+
// This is more reliable across different environments
|
|
51
|
+
await copyDirRecursive(packageDocsDir, consumerDocsDir);
|
|
35
52
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} else {
|
|
41
|
-
// On POSIX, create a directory symlink
|
|
42
|
-
await fs.promises.symlink(packageDocsDir, consumerDocsDir, 'dir');
|
|
43
|
-
}
|
|
44
|
-
} catch {
|
|
45
|
-
// Never fail install because of docs-linking issues
|
|
53
|
+
} catch (error) {
|
|
54
|
+
// Never fail install because of docs-copying issues
|
|
55
|
+
// In production, this should be silent, but for debugging we'll leave it
|
|
56
|
+
console.warn('Warning: Failed to copy agent-docs to consumer docs directory:', error.message);
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
59
|
|
package/docs/VSCODE.md
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
# VS Code Extension for Code Analyzer
|
|
2
|
-
|
|
3
|
-
> **Version**: 1.0.0
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The Salesforce Code Analyzer Visual Studio Code Extension integrates Code
|
|
8
|
-
Analyzer's static analysis capabilities directly into the VS Code environment,
|
|
9
|
-
providing real-time feedback and code scanning during development.
|
|
10
|
-
|
|
11
|
-
**Reference:**
|
|
12
|
-
[Use the VS Code Extension to Analyze Your Code](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/analyze-vscode.html)
|
|
13
|
-
|
|
14
|
-
## Prerequisites
|
|
15
|
-
|
|
16
|
-
- Visual Studio Code installed
|
|
17
|
-
- Salesforce CLI installed and configured
|
|
18
|
-
- Salesforce Extensions for VS Code installed
|
|
19
|
-
|
|
20
|
-
## Installation
|
|
21
|
-
|
|
22
|
-
### Step 1: Install Salesforce CLI
|
|
23
|
-
|
|
24
|
-
Ensure Salesforce CLI is installed on your system:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
sf --version
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
If not installed, download from
|
|
31
|
-
[Salesforce CLI](https://developer.salesforce.com/tools/salesforcecli).
|
|
32
|
-
|
|
33
|
-
### Step 2: Install Salesforce Extensions for VS Code
|
|
34
|
-
|
|
35
|
-
The Code Analyzer extension is included in the Salesforce Extensions for VS Code
|
|
36
|
-
extension pack:
|
|
37
|
-
|
|
38
|
-
1. Open VS Code
|
|
39
|
-
2. Go to Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
|
|
40
|
-
3. Search for "Salesforce Extension Pack"
|
|
41
|
-
4. Click Install
|
|
42
|
-
|
|
43
|
-
Alternatively, install the Code Analyzer extension directly by searching for
|
|
44
|
-
"Salesforce Code Analyzer".
|
|
45
|
-
|
|
46
|
-
### Step 3: Install Code Analyzer CLI Plugin
|
|
47
|
-
|
|
48
|
-
The VS Code extension requires the Code Analyzer CLI plugin. Install it via
|
|
49
|
-
terminal:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
sf plugins install @salesforce/sfdx-scanner
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Or open the VS Code integrated terminal (Ctrl+` / Cmd+`) and run:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
sf plugins install @salesforce/sfdx-scanner
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Verify installation:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
sf scanner --help
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Usage
|
|
68
|
-
|
|
69
|
-
### Scan Selected Files or Folders
|
|
70
|
-
|
|
71
|
-
1. In VS Code Explorer, select one or more files or folders
|
|
72
|
-
2. Right-click the selection
|
|
73
|
-
3. Choose **"SFDX: Scan Selected Files or Folders with Code Analyzer"**
|
|
74
|
-
|
|
75
|
-
The extension will analyze the selected items and display results in the
|
|
76
|
-
Problems panel.
|
|
77
|
-
|
|
78
|
-
### Scan Current File
|
|
79
|
-
|
|
80
|
-
1. Open a file in the editor
|
|
81
|
-
2. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
|
|
82
|
-
3. Type and select **"SFDX: Scan Current File with Code Analyzer"**
|
|
83
|
-
|
|
84
|
-
The current file will be analyzed and violations will be shown in the Problems
|
|
85
|
-
panel.
|
|
86
|
-
|
|
87
|
-
### Scan Workspace
|
|
88
|
-
|
|
89
|
-
To scan the entire workspace:
|
|
90
|
-
|
|
91
|
-
1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
|
|
92
|
-
2. Type and select **"SFDX: Scan Workspace with Code Analyzer"**
|
|
93
|
-
|
|
94
|
-
## Viewing Results
|
|
95
|
-
|
|
96
|
-
### Problems Panel
|
|
97
|
-
|
|
98
|
-
After scanning, results are displayed in the **Problems** panel (View → Problems
|
|
99
|
-
or Ctrl+Shift+M / Cmd+Shift+M):
|
|
100
|
-
|
|
101
|
-
- **Severity**: Indicated by icon color (Error/Warning/Info)
|
|
102
|
-
- **File**: Click to navigate to the violation location
|
|
103
|
-
- **Rule**: Rule name and description
|
|
104
|
-
- **Line**: Line number where violation occurs
|
|
105
|
-
- **Message**: Detailed violation message
|
|
106
|
-
|
|
107
|
-
### Inline Annotations
|
|
108
|
-
|
|
109
|
-
Violations appear as inline annotations in the editor:
|
|
110
|
-
|
|
111
|
-
- Red squiggles for errors (High/Critical severity)
|
|
112
|
-
- Yellow squiggles for warnings (Moderate severity)
|
|
113
|
-
- Blue squiggles for info (Low/Info severity)
|
|
114
|
-
|
|
115
|
-
Hover over annotations to see detailed violation information.
|
|
116
|
-
|
|
117
|
-
### Quick Actions
|
|
118
|
-
|
|
119
|
-
Right-click on a violation in the Problems panel or editor to access:
|
|
120
|
-
|
|
121
|
-
- **Go to Definition**: Navigate to rule definition
|
|
122
|
-
- **View Rule Details**: See full rule documentation
|
|
123
|
-
- **Copy Violation**: Copy violation details to clipboard
|
|
124
|
-
|
|
125
|
-
## Configuration
|
|
126
|
-
|
|
127
|
-
### Extension Settings
|
|
128
|
-
|
|
129
|
-
Configure Code Analyzer extension behavior via VS Code settings:
|
|
130
|
-
|
|
131
|
-
1. Open Settings (Ctrl+, / Cmd+,)
|
|
132
|
-
2. Search for "Salesforce Code Analyzer"
|
|
133
|
-
|
|
134
|
-
Available settings:
|
|
135
|
-
|
|
136
|
-
- **Enable/Disable**: Toggle Code Analyzer on/off
|
|
137
|
-
- **Auto-scan on Save**: Automatically scan files when saved
|
|
138
|
-
- **Default Engine**: Set default engine for scanning
|
|
139
|
-
- **Severity Mapping**: Map Code Analyzer severities to VS Code severities
|
|
140
|
-
- **Excluded Patterns**: Patterns to exclude from scanning
|
|
141
|
-
|
|
142
|
-
### Project Configuration
|
|
143
|
-
|
|
144
|
-
The extension respects `code-analyzer.yml` configuration in your project root.
|
|
145
|
-
For detailed configuration options, see
|
|
146
|
-
[Code Analyzer Configuration](CODEANALYZER.md).
|
|
147
|
-
|
|
148
|
-
Example `code-analyzer.yml`:
|
|
149
|
-
|
|
150
|
-
```yaml
|
|
151
|
-
engines:
|
|
152
|
-
pmd:
|
|
153
|
-
custom_rulesets:
|
|
154
|
-
- rulesets/design/InnerClassesCannotBeStatic.xml
|
|
155
|
-
|
|
156
|
-
rules:
|
|
157
|
-
pmd:
|
|
158
|
-
NoSingleLetterVariableNames:
|
|
159
|
-
severity: 'High'
|
|
160
|
-
tags: ['Recommended']
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Keyboard Shortcuts
|
|
164
|
-
|
|
165
|
-
Default keyboard shortcuts:
|
|
166
|
-
|
|
167
|
-
- **Scan Current File**: Not assigned by default (use Command Palette)
|
|
168
|
-
- **Scan Selected Files**: Not assigned by default (use context menu)
|
|
169
|
-
|
|
170
|
-
You can assign custom shortcuts via:
|
|
171
|
-
|
|
172
|
-
1. File → Preferences → Keyboard Shortcuts (Ctrl+K Ctrl+S / Cmd+K Cmd+S)
|
|
173
|
-
2. Search for "Salesforce Code Analyzer"
|
|
174
|
-
3. Assign desired shortcuts
|
|
175
|
-
|
|
176
|
-
## Troubleshooting
|
|
177
|
-
|
|
178
|
-
### Extension Not Working
|
|
179
|
-
|
|
180
|
-
1. Verify Salesforce CLI is installed and in PATH
|
|
181
|
-
2. Verify Code Analyzer plugin is installed: `sf plugins list`
|
|
182
|
-
3. Check VS Code Output panel for errors (View → Output, select "Salesforce Code
|
|
183
|
-
Analyzer")
|
|
184
|
-
4. Reload VS Code window (Ctrl+Shift+P → "Developer: Reload Window")
|
|
185
|
-
|
|
186
|
-
### No Results Displayed
|
|
187
|
-
|
|
188
|
-
1. Verify files are supported file types (`.cls`, `.trigger`, `.js`, `.ts`,
|
|
189
|
-
`.html`, `.cmp`, etc.)
|
|
190
|
-
2. Check `code-analyzer.yml` configuration
|
|
191
|
-
3. Verify rules are enabled and not filtered out
|
|
192
|
-
4. Check VS Code Output panel for scanning errors
|
|
193
|
-
|
|
194
|
-
### Slow Performance
|
|
195
|
-
|
|
196
|
-
1. Exclude unnecessary files via `code-analyzer.yml` patterns
|
|
197
|
-
2. Disable auto-scan on save for large workspaces
|
|
198
|
-
3. Scan individual files/folders instead of entire workspace
|
|
199
|
-
4. Check system resources (CPU, memory)
|
|
200
|
-
|
|
201
|
-
### Plugin Not Found
|
|
202
|
-
|
|
203
|
-
If extension reports CLI plugin not found:
|
|
204
|
-
|
|
205
|
-
1. Verify plugin installation: `sf plugins list | grep scanner`
|
|
206
|
-
2. Reinstall plugin: `sf plugins install @salesforce/sfdx-scanner --force`
|
|
207
|
-
3. Check Salesforce CLI version compatibility
|
|
208
|
-
4. Restart VS Code
|
|
209
|
-
|
|
210
|
-
## Best Practices
|
|
211
|
-
|
|
212
|
-
1. **Configure Rules**: Customize `code-analyzer.yml` to match your team's
|
|
213
|
-
standards
|
|
214
|
-
2. **Regular Scanning**: Scan code regularly during development, not just before
|
|
215
|
-
commits
|
|
216
|
-
3. **Fix High Priority**: Address High and Critical severity violations first
|
|
217
|
-
4. **Use Tags**: Leverage rule tags (e.g., "Recommended") to focus on important
|
|
218
|
-
rules
|
|
219
|
-
5. **Review Results**: Don't blindly fix all violations; understand rule
|
|
220
|
-
rationale
|
|
221
|
-
6. **Exclude Patterns**: Exclude generated files and third-party code from
|
|
222
|
-
scanning
|
|
223
|
-
|
|
224
|
-
## Related Documentation
|
|
225
|
-
|
|
226
|
-
- **[CLI Commands](CODEANALYZER.md#cli-commands)** - Command-line usage of Code
|
|
227
|
-
Analyzer
|
|
228
|
-
- **[Code Analyzer Configuration](CODEANALYZER.md)** - Complete configuration
|
|
229
|
-
reference
|
|
230
|
-
- **[PMD Engine](PMD.md)** - PMD rules and configuration
|
|
231
|
-
- **[ESLint Engine](ESLINT.md)** - ESLint rules for JavaScript/TypeScript/LWC
|