Skip to content

Commit

Permalink
Updates to latest typescript & eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Apr 1, 2019
1 parent 6e42e4d commit 8cbfc0c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4998,7 +4998,7 @@
"clean-webpack-plugin": "2.0.1",
"circular-dependency-plugin": "5.0.2",
"css-loader": "2.1.1",
"eslint": "5.15.3",
"eslint": "5.16.0",
"eslint-cli": "1.1.1",
"eslint-config-prettier": "4.1.0",
"eslint-loader": "2.1.2",
Expand All @@ -5014,7 +5014,7 @@
"sass-loader": "7.1.0",
"terser-webpack-plugin": "1.2.3",
"ts-loader": "5.3.3",
"typescript": "3.2.4",
"typescript": "3.4.1",
"vsce": "1.59.0",
"vscode": "1.1.33",
"webpack": "4.29.6",
Expand Down
14 changes: 9 additions & 5 deletions src/trackers/documentTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,19 @@ export class DocumentTracker<T> implements Disposable {
}

private async _add(documentOrId: TextDocument | Uri): Promise<TrackedDocument<T>> {
let document;
if (documentOrId instanceof GitUri) {
try {
documentOrId = await workspace.openTextDocument(documentOrId.documentUri({ useVersionedPath: true }));
document = await workspace.openTextDocument(documentOrId.documentUri({ useVersionedPath: true }));
}
catch (ex) {
const msg = ex.toString();
if (msg.includes('File seems to be binary and cannot be opened as text')) {
documentOrId = new BinaryTextDocument(documentOrId);
document = new BinaryTextDocument(documentOrId);
}
else if (msg.includes('File not found')) {
// If we can't find the file, assume it is because the file has been renamed or deleted at some point
documentOrId = new MissingRevisionTextDocument(documentOrId);
document = new MissingRevisionTextDocument(documentOrId);

// const [fileName, repoPath] = await Container.git.findWorkingFileName(documentOrId, undefined, ref);
// if (fileName === undefined) throw new Error(`Failed to add tracking for document: ${documentOrId}`);
Expand All @@ -259,10 +260,13 @@ export class DocumentTracker<T> implements Disposable {
}
}
else if (documentOrId instanceof Uri) {
documentOrId = await workspace.openTextDocument(documentOrId);
document = await workspace.openTextDocument(documentOrId);
}
else {
document = documentOrId;
}

const doc = await this.addCore(documentOrId);
const doc = await this.addCore(document);
await doc.ensureInitialized();

return doc;
Expand Down

0 comments on commit 8cbfc0c

Please sign in to comment.