File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
318318 console . warn ( 'TypeScript: reported ' + diagnostics . length + ' semantic errors.' ) ;
319319 for ( let diagnostic of diagnostics ) {
320320 let text = diagnostic . messageText ;
321- if ( typeof text !== 'string' ) {
321+ if ( text && typeof text !== 'string' ) {
322322 text = text . messageText ;
323323 }
324324 let locationStr = '' ;
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ import * as pathlib from "path";
22import * as ts from "./typescript" ;
33
44/**
5- * Mapping from the source root to the virtual source root.
5+ * Mapping from the real source root to the virtual source root,
6+ * a directory whose folder structure mirrors the real source root, but with `node_modules` installed.
67 */
78export class VirtualSourceRoot {
89 constructor (
Original file line number Diff line number Diff line change @@ -709,12 +709,12 @@ protected DependencyInstallationResult installDependencies(Set<Path> filesToExtr
709709 propsToRemove .add (packageName );
710710 } else {
711711 // Remove file dependency on a package that don't exist in the checkout.
712- String dependecy = getChildAsString (dependencyObj , packageName );
713- if (dependecy != null && (dependecy .startsWith ("file:" ) || dependecy .startsWith ("./" ) || dependecy .startsWith ("../" ))) {
714- if (dependecy .startsWith ("file:" )) {
715- dependecy = dependecy .substring ("file:" .length ());
712+ String dependency = getChildAsString (dependencyObj , packageName );
713+ if (dependency != null && (dependency .startsWith ("file:" ) || dependency .startsWith ("./" ) || dependency .startsWith ("../" ))) {
714+ if (dependency .startsWith ("file:" )) {
715+ dependency = dependency .substring ("file:" .length ());
716716 }
717- Path resolvedPackage = path .getParent ().resolve (dependecy + "/package.json" );
717+ Path resolvedPackage = path .getParent ().resolve (dependency + "/package.json" );
718718 if (!Files .exists (resolvedPackage )) {
719719 propsToRemove .add (packageName );
720720 }
You can’t perform that action at this time.
0 commit comments