Merge pull request #2465 from akshita31/fs_path

Use the fsPath instead of path in the virtual document tracker
This commit is contained in:
Akshita Agarwal 2018-08-17 13:46:04 -07:00 коммит произвёл GitHub
Родитель 9fbb4e1050 cfba76ec86
Коммит c7b1d88288
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -63,7 +63,13 @@ function shouldIgnoreDocument(document: TextDocument, server: OmniSharpServer):
}
async function openVirtualDocument(document: TextDocument, server: OmniSharpServer, eventStream: EventStream) {
let req = { FileName: document.uri.path, changeType: FileChangeType.Create };
let path = document.uri.fsPath;
if (!path) {
path = document.uri.path;
}
let req = { FileName: path, changeType: FileChangeType.Create };
try {
await serverUtils.filesChanged(server, [req]);
await serverUtils.updateBuffer(server, { Buffer: document.getText(), FileName: document.fileName });
@ -74,7 +80,13 @@ async function openVirtualDocument(document: TextDocument, server: OmniSharpServ
}
async function closeVirtualDocument(document: TextDocument, server: OmniSharpServer, eventStream: EventStream) {
let req = { FileName: document.uri.path, changeType: FileChangeType.Delete };
let path = document.uri.fsPath;
if (!path) {
path = document.uri.path;
}
let req = { FileName: path, changeType: FileChangeType.Delete };
try {
await serverUtils.filesChanged(server, [req]);
}