-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuserManager.js
33 lines (33 loc) · 953 Bytes
/
userManager.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class UserManager {
constructor() {
this.clients = {};
this.ignoredclients = [];
}
setPosition(clientId, fileName, document, range, isReversed) {
const documentUri = document.uri.toString();
const startOffset = document.offsetAt(range.start);
const endOffset = document.offsetAt(range.end);
this.clients[clientId] = {
fileName,
documentUri,
range,
isReversed,
startOffset,
endOffset
};
}
getPosition(clientId) {
if (this.ignoredclients.includes(clientId))
return null;
return this.clients[clientId];
}
removeClient(clientId) {
delete this.clients[clientId];
}
addIgnoredClient(clientid) {
this.ignoredclients.push(clientid);
}
}
exports.UserManager = UserManager;