forked from eclipse-theia/theia
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fs] added JSON-RPC support for fs-watcher
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
- Loading branch information
Showing
15 changed files
with
385 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2017 TypeFox and others. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
|
||
import { Disposable } from '../../application/common'; | ||
|
||
export const fileSystemWatcherPath = '/fs-watcher'; | ||
|
||
export const FileSystemWatcherServer = Symbol('FileSystemWatcherServer'); | ||
export interface FileSystemWatcherServer extends Disposable { | ||
/** | ||
* Allows to start a watcher that reports file change events on the provided resource. | ||
* | ||
* Resolve when watching of the given uri is started. | ||
* Reject if a file for the given uri does not exist. | ||
*/ | ||
watchFileChanges(uri: string): Promise<void>; | ||
|
||
/** | ||
* Allows to stop a watcher on the provided resource or absolute fs path. | ||
*/ | ||
unwatchFileChanges(uri: string): Promise<void>; | ||
} | ||
|
||
export interface FileSystemWatcherClient extends Disposable { | ||
/** | ||
* Notifies about file changes | ||
*/ | ||
onDidFilesChanged(event: DidFilesChangedParams): void; | ||
} | ||
|
||
export interface DidFilesChangedParams { | ||
changes: FileChange[]; | ||
} | ||
|
||
export interface FileChange { | ||
uri: string; | ||
type: FileChangeType; | ||
} | ||
|
||
export enum FileChangeType { | ||
UPDATED = 0, | ||
ADDED = 1, | ||
DELETED = 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.