Skip to content

Commit 9f549b1

Browse files
committed
I do not want to be in the business of file watching. Its:
* unreliable across OSes * memory heavy I would do the complex stuff of diffing our states if the base was reliable. Since it isn't we will provide a soft reset option instead.
1 parent 8b86c01 commit 9f549b1

File tree

153 files changed

+0
-14923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+0
-14923
lines changed

dist/main/lang/projectService.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ function watchProjectFileIfNotDoingItAlready(projectFilePath) {
5151
}
5252
});
5353
}
54-
var chokidar = require('chokidar');
5554
var watchingTheFilesInTheProject = {};
5655
function watchTheFilesInTheProjectIfNotDoingItAlready(projectFile) {
5756
var projectFilePath = projectFile.projectFilePath;
@@ -61,26 +60,6 @@ function watchTheFilesInTheProjectIfNotDoingItAlready(projectFile) {
6160
if (watchingTheFilesInTheProject[projectFilePath])
6261
return;
6362
watchingTheFilesInTheProject[projectFilePath] = true;
64-
var watcher = chokidar.watch(projectFile.project.files || projectFile.project.filesGlob);
65-
watcher.on('add', function () {
66-
});
67-
watcher.on('unlink', function (filePath) {
68-
});
69-
watcher.on('change', function (filePath) {
70-
filePath = tsconfig.consistentPath(filePath);
71-
queryParent.getOpenEditorPaths({}).then(function (res) {
72-
var openPaths = res.filePaths;
73-
if (openPaths.some(function (x) { return x == filePath; })) {
74-
return;
75-
}
76-
var project = projectByFilePath[filePath];
77-
if (!project) {
78-
return;
79-
}
80-
var contents = fs.readFileSync(filePath).toString();
81-
project.languageServiceHost.updateScript(filePath, contents);
82-
});
83-
});
8463
}
8564
function cacheAndCreateProject(projectFile) {
8665
var project = projectByProjectFilePath[projectFile.projectFilePath] = new Project(projectFile);

lib/globals.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,11 @@ declare module 'atom-space-pen-views' {
3535
export var $: JQueryStatic;
3636
}
3737

38-
/** https://github.com/paulmillr/chokidar */
39-
declare module 'chokidar' {
40-
export interface Watcher {
41-
on: (event: string, callback: (path: string) => any) => any;
42-
}
43-
44-
export function watch(path, options?: any): Watcher;
45-
}
46-
4738
declare module 'basarat-text-buffer' {
4839
var options;
4940
export = options;
5041
}
5142

52-
5343
interface EmitOutput {
5444
outputFiles: string[];
5545
success: boolean;

lib/main/lang/projectService.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ function watchProjectFileIfNotDoingItAlready(projectFilePath: string) {
8686
});
8787
}
8888

89-
90-
import chokidar = require('chokidar');
9189
var watchingTheFilesInTheProject: { [projectFilePath: string]: boolean } = {}
9290
function watchTheFilesInTheProjectIfNotDoingItAlready(projectFile: tsconfig.TypeScriptProjectFileDetails) {
9391
var projectFilePath = projectFile.projectFilePath;
@@ -99,36 +97,6 @@ function watchTheFilesInTheProjectIfNotDoingItAlready(projectFile: tsconfig.Type
9997

10098
if (watchingTheFilesInTheProject[projectFilePath]) return; // Only watch once
10199
watchingTheFilesInTheProject[projectFilePath] = true;
102-
103-
var watcher = chokidar.watch(projectFile.project.files || projectFile.project.filesGlob);
104-
watcher.on('add', () => {
105-
// TODO: add file to project:
106-
// files + language service, and then the language service will automatically call LSHost
107-
});
108-
watcher.on('unlink', (filePath: string) => {
109-
// TODO: remove from language service + files
110-
});
111-
watcher.on('change', (filePath: string) => {
112-
filePath = tsconfig.consistentPath(filePath);
113-
queryParent.getOpenEditorPaths({}).then((res) => {
114-
var openPaths = res.filePaths;
115-
116-
// If we have it open, we will get this change from ATOM.
117-
if (openPaths.some(x => x == filePath)) {
118-
return;
119-
}
120-
121-
// If we don't have it cached. Then we ain't gonna do anything with this as it can get hairy
122-
var project = projectByFilePath[filePath];
123-
if (!project) {
124-
// console.error('file change ignored. No Project!:', filePath);
125-
return;
126-
}
127-
128-
var contents = fs.readFileSync(filePath).toString();
129-
project.languageServiceHost.updateScript(filePath, contents);
130-
});
131-
})
132100
}
133101

134102
/** We are loading the project from file system.

node_modules/chokidar/README.md

Lines changed: 0 additions & 200 deletions
This file was deleted.

0 commit comments

Comments
 (0)