Skip to content

Commit 52de5e5

Browse files
refactor: Remove redundant workspaceRoot field (#113)
We already track a projectRoot field which is the same. No functional change.
1 parent 2c8f24f commit 52de5e5

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

packages/pyright-scip/src/indexer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class Indexer {
231231
if (this.scipConfig.targetOnly && this.scipConfig.targetOnly !== '') {
232232
return this.scipConfig.targetOnly;
233233
} else {
234-
return this.scipConfig.workspaceRoot;
234+
return this.scipConfig.projectRoot;
235235
}
236236
}
237237
}

packages/pyright-scip/src/lib.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export interface ScipConfig extends IndexOptions {
1414
*
1515
* All `Document.relative_path` fields will be relative paths to this directory.
1616
*/
17-
workspaceRoot: string;
18-
1917
projectRoot: string;
2018

2119
infer: { projectVersionFromCommit: boolean };

packages/pyright-scip/src/main-impl.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@ function indexAction(options: IndexOptions): void {
1616
setShowProgressRateLimit(options.showProgressRateLimit);
1717
}
1818

19-
const workspaceRoot = options.cwd;
19+
const projectRoot = options.cwd;
2020
const snapshotDir = options.snapshotDir;
2121
const environment = options.environment;
2222

23-
const projectRoot = workspaceRoot;
24-
process.chdir(workspaceRoot);
23+
process.chdir(projectRoot);
2524

2625
const outputFile = path.join(projectRoot, options.output);
2726
const output = fs.openSync(outputFile, 'w');
2827

2928
try {
3029
let indexer = new Indexer({
3130
...options,
32-
workspaceRoot,
3331
projectRoot,
3432
environment,
3533
infer: { projectVersionFromCommit: true },
@@ -106,7 +104,6 @@ function snapshotAction(snapshotRoot: string, options: SnapshotOptions): void {
106104
if (options.index) {
107105
let indexer = new Indexer({
108106
...options,
109-
workspaceRoot: projectRoot,
110107
projectRoot,
111108
environment,
112109
infer: { projectVersionFromCommit: false },

0 commit comments

Comments
 (0)