Skip to content

Commit 38cf79c

Browse files
committed
fix: filter out the editors that don't have paths. We do not care about them. This is because of the strong nature of a filesystem based TypeScript project
closes #128
1 parent a5e8522 commit 38cf79c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/main/atom/atomUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function getFilePathPosition() {
3434
exports.getFilePathPosition = getFilePathPosition;
3535
function getEditorsForAllPaths(filePaths) {
3636
var map = {};
37-
var activeEditors = atom.workspace.getEditors();
37+
var activeEditors = atom.workspace.getEditors().filter(function (editor) { return !!editor.getPath(); });
3838
function addConsistentlyToMap(editor) {
3939
map[tsconfig.consistentPath(editor.getPath())] = editor;
4040
}

lib/main/atom/atomUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function getFilePathPosition(): { filePath: string; position: number } {
4242

4343
export function getEditorsForAllPaths(filePaths: string[]): Promise<{ [filePath: string]: AtomCore.IEditor }> {
4444
var map = <any>{};
45-
var activeEditors = atom.workspace.getEditors();
45+
var activeEditors = atom.workspace.getEditors().filter(editor=> !!editor.getPath());
4646

4747
function addConsistentlyToMap(editor: AtomCore.IEditor) {
4848
map[tsconfig.consistentPath(editor.getPath())] = editor;

0 commit comments

Comments
 (0)