TS: Other review comments

This commit is contained in:
Asger Feldthaus
2020-01-30 12:41:02 +00:00
parent 92dbfb2858
commit 1bf8165098
3 changed files with 8 additions and 7 deletions

View File

@@ -318,7 +318,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
console.warn('TypeScript: reported ' + diagnostics.length + ' semantic errors.');
for (let diagnostic of diagnostics) {
let text = diagnostic.messageText;
if (typeof text !== 'string') {
if (text && typeof text !== 'string') {
text = text.messageText;
}
let locationStr = '';

View File

@@ -2,7 +2,8 @@ import * as pathlib from "path";
import * as ts from "./typescript";
/**
* Mapping from the source root to the virtual source root.
* Mapping from the real source root to the virtual source root,
* a directory whose folder structure mirrors the real source root, but with `node_modules` installed.
*/
export class VirtualSourceRoot {
constructor(

View File

@@ -709,12 +709,12 @@ public class AutoBuild {
propsToRemove.add(packageName);
} else {
// Remove file dependency on a package that don't exist in the checkout.
String dependecy = getChildAsString(dependencyObj, packageName);
if (dependecy != null && (dependecy.startsWith("file:") || dependecy.startsWith("./") || dependecy.startsWith("../"))) {
if (dependecy.startsWith("file:")) {
dependecy = dependecy.substring("file:".length());
String dependency = getChildAsString(dependencyObj, packageName);
if (dependency != null && (dependency.startsWith("file:") || dependency.startsWith("./") || dependency.startsWith("../"))) {
if (dependency.startsWith("file:")) {
dependency = dependency.substring("file:".length());
}
Path resolvedPackage = path.getParent().resolve(dependecy + "/package.json");
Path resolvedPackage = path.getParent().resolve(dependency + "/package.json");
if (!Files.exists(resolvedPackage)) {
propsToRemove.add(packageName);
}