Skip to content

Commit 79eef9e

Browse files
fix: Limit macOS fix to pyright-scip-side code changes (#178)
In PR #177, I added normalization logic inside setTrackedFiles. However, it seems like the other file tracking already must be taking care of passing normalized paths as necessary (hopefully?). In order to minimize the diff size, I'm moving the normalization to the call-site of setTrackedFiles inside the pyright-scip folder. We want to do a merge of upstream changes sooner rather than later, so it'd be good to reduce the diff.
1 parent 8baba24 commit 79eef9e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/pyright-internal/src/analyzer/program.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,7 @@ export class Program {
293293
}
294294

295295
// Add the new files. Only the new items will be added.
296-
// Normalize paths to ensure consistency with other code paths.
297-
const normalizedFilePaths = filePaths.map(path => normalizePathCase(this._fs, path));
298-
this.addTrackedFiles(normalizedFilePaths);
296+
this.addTrackedFiles(filePaths);
299297

300298
return this._removeUnneededFiles();
301299
}

packages/pyright-scip/src/indexer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { createFromRealFileSystem } from 'pyright-internal/common/realFileSystem
99
import { ConfigOptions } from 'pyright-internal/common/configOptions';
1010
import { TreeVisitor } from './treeVisitor';
1111
import { FullAccessHost } from 'pyright-internal/common/fullAccessHost';
12+
import { normalizePathCase } from 'pyright-internal/common/pathUtils';
1213
import * as url from 'url';
1314
import { ScipConfig } from './lib';
1415
import { SourceFile } from 'pyright-internal/analyzer/sourceFile';
@@ -122,7 +123,9 @@ export class Indexer {
122123
this.importResolver = new ImportResolver(fs, this.pyrightConfig, host);
123124

124125
this.program = new Program(this.importResolver, this.pyrightConfig);
125-
this.program.setTrackedFiles([...this.projectFiles]);
126+
// Normalize paths to ensure consistency with other code paths.
127+
const normalizedProjectFiles = [...this.projectFiles].map((path: string) => normalizePathCase(fs, path));
128+
this.program.setTrackedFiles(normalizedProjectFiles);
126129

127130
if (scipConfig.projectNamespace) {
128131
setProjectNamespace(scipConfig.projectName, this.scipConfig.projectNamespace!);

0 commit comments

Comments
 (0)