-
-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #801 from vuejs/DocumentService
[WIP] Initial cut for document manager. #800
- Loading branch information
Showing
15 changed files
with
388 additions
and
394 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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
import { IConnection, TextDocuments } from 'vscode-languageserver'; | ||
|
||
/** | ||
* Service responsible for managing documents being syned through LSP | ||
* Todo - Switch to incremental sync | ||
*/ | ||
export class DocumentService { | ||
private documents: TextDocuments; | ||
|
||
constructor() { | ||
this.documents = new TextDocuments(); | ||
} | ||
|
||
listen(conn: IConnection) { | ||
this.documents.listen(conn); | ||
} | ||
|
||
getDocument(uri: string) { | ||
return this.documents.get(uri); | ||
} | ||
|
||
getAllDocuments() { | ||
return this.documents.all(); | ||
} | ||
|
||
get onDidChangeContent() { | ||
return this.documents.onDidChangeContent; | ||
} | ||
get onDidClose() { | ||
return this.documents.onDidClose; | ||
} | ||
} |
Oops, something went wrong.