mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
spelling fixes for src/compiler
* after * aggressive * appear * asterisks * candidate * conflict * directory * dollar * ellipsis * exports * failures * folder * followed * highlight * inferred * location * occurred * output * propagated * push * rather * remaining * search * stabilized * substitution * successful * even though * will * with
This commit is contained in:
@@ -667,7 +667,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getNormalizedPathComponentsOfUrl(url: string) {
|
||||
// Get root length of http://www.website.com/folder1/foler2/
|
||||
// Get root length of http://www.website.com/folder1/folder2/
|
||||
// In this example the root is: http://www.website.com/
|
||||
// normalized path components should be ["http://www.website.com/", "folder1", "folder2"]
|
||||
|
||||
@@ -695,7 +695,7 @@ namespace ts {
|
||||
const indexOfNextSlash = url.indexOf(directorySeparator, rootLength);
|
||||
if (indexOfNextSlash !== -1) {
|
||||
// Found the "/" after the website.com so the root is length of http://www.website.com/
|
||||
// and get components afetr the root normally like any other folder components
|
||||
// and get components after the root normally like any other folder components
|
||||
rootLength = indexOfNextSlash + 1;
|
||||
return normalizedPathComponents(url, rootLength);
|
||||
}
|
||||
|
||||
+10
-10
@@ -407,14 +407,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
|
||||
interface ConvertedLoopState {
|
||||
/*
|
||||
* set of labels that occured inside the converted loop
|
||||
* set of labels that occurred inside the converted loop
|
||||
* used to determine if labeled jump can be emitted as is or it should be dispatched to calling code
|
||||
*/
|
||||
labels?: Map<string>;
|
||||
/*
|
||||
* collection of labeled jumps that transfer control outside the converted loop.
|
||||
* maps store association 'label -> labelMarker' where
|
||||
* - label - value of label as it apprear in code
|
||||
* - label - value of label as it appear in code
|
||||
* - label marker - return value that should be interpreted by calling code as 'jump to <label>'
|
||||
*/
|
||||
labeledNonLocalBreaks?: Map<string>;
|
||||
@@ -437,7 +437,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
* i.e.
|
||||
* for (let x;;) <statement that captures x in closure and uses 'arguments'>
|
||||
* should be converted to
|
||||
* var loop = function(x) { <code where 'arguments' is replaced witg 'arguments_1'> }
|
||||
* var loop = function(x) { <code where 'arguments' is replaced with 'arguments_1'> }
|
||||
* var arguments_1 = arguments
|
||||
* for (var x;;) loop(x);
|
||||
* otherwise semantics of the code will be different since 'arguments' inside converted loop body
|
||||
@@ -1005,7 +1005,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
// Examples: `\n` is converted to "\\n", a template string with a newline to "\n".
|
||||
let text = getTextOfNodeFromSourceText(currentText, node);
|
||||
|
||||
// text contains the original source, it will also contain quotes ("`"), dolar signs and braces ("${" and "}"),
|
||||
// text contains the original source, it will also contain quotes ("`"), dollar signs and braces ("${" and "}"),
|
||||
// thus we need to remove those characters.
|
||||
// First template piece starts with "`", others with "}"
|
||||
// Last template piece ends with "`", others with "${"
|
||||
@@ -4064,14 +4064,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
if (properties.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
// When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment
|
||||
// When doing so we want to highlight the passed in source map node since thats the one needing this temp assignment
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode);
|
||||
}
|
||||
for (const p of properties) {
|
||||
if (p.kind === SyntaxKind.PropertyAssignment || p.kind === SyntaxKind.ShorthandPropertyAssignment) {
|
||||
const propName = <Identifier | LiteralExpression>(<PropertyAssignment>p).name;
|
||||
const target = p.kind === SyntaxKind.ShorthandPropertyAssignment ? <ShorthandPropertyAssignment>p : (<PropertyAssignment>p).initializer || propName;
|
||||
// Assignment for target = value.propName should highligh whole property, hence use p as source map node
|
||||
// Assignment for target = value.propName should highlight whole property, hence use p as source map node
|
||||
emitDestructuringAssignment(target, createPropertyAccessForDestructuringProperty(value, propName), p);
|
||||
}
|
||||
}
|
||||
@@ -4082,13 +4082,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
if (elements.length !== 1) {
|
||||
// For anything but a single element destructuring we need to generate a temporary
|
||||
// to ensure value is evaluated exactly once.
|
||||
// When doing so we want to hightlight the passed in source map node since thats the one needing this temp assignment
|
||||
// When doing so we want to highlight the passed in source map node since thats the one needing this temp assignment
|
||||
value = ensureIdentifier(value, /*reuseIdentifierExpressions*/ true, sourceMapNode);
|
||||
}
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
const e = elements[i];
|
||||
if (e.kind !== SyntaxKind.OmittedExpression) {
|
||||
// Assignment for target = value.propName should highligh whole property, hence use e as source map node
|
||||
// Assignment for target = value.propName should highlight whole property, hence use e as source map node
|
||||
if (e.kind !== SyntaxKind.SpreadElementExpression) {
|
||||
emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)), e);
|
||||
}
|
||||
@@ -6746,7 +6746,7 @@ const _super = (function (geti, seti) {
|
||||
// when resolving exports local exported entries/indirect exported entries in the module
|
||||
// should always win over entries with similar names that were added via star exports
|
||||
// to support this we store names of local/indirect exported entries in a set.
|
||||
// this set is used to filter names brought by star expors.
|
||||
// this set is used to filter names brought by star exports.
|
||||
if (!hasExportStarsToExportValues) {
|
||||
// local names set is needed only in presence of star exports
|
||||
return undefined;
|
||||
@@ -8077,7 +8077,7 @@ const _super = (function (geti, seti) {
|
||||
// declare var x;
|
||||
// /// <reference-path ...>
|
||||
// interface F {}
|
||||
// The first /// will NOT be removed while the second one will be removed eventhough both node will not be emitted
|
||||
// The first /// will NOT be removed while the second one will be removed even though both node will not be emitted
|
||||
if (node.pos === 0) {
|
||||
leadingComments = filter(getLeadingCommentsToEmit(node), isTripleSlashComment);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace ts {
|
||||
* 'typings' entry or file 'index' with some supported extension
|
||||
* - Classic loader will only try to interpret '/a/b/c' as file.
|
||||
*/
|
||||
type ResolutionKindSpecificLoader = (candidate: string, extensions: string[], failedLookupLocations: string[], onlyRecordFalures: boolean, state: ModuleResolutionState) => string;
|
||||
type ResolutionKindSpecificLoader = (candidate: string, extensions: string[], failedLookupLocations: string[], onlyRecordFailures: boolean, state: ModuleResolutionState) => string;
|
||||
|
||||
/**
|
||||
* Any module resolution kind can be augmented with optional settings: 'baseUrl', 'paths' and 'rootDirs' - they are used to
|
||||
@@ -151,7 +151,7 @@ namespace ts {
|
||||
* fallback to standard resolution routine.
|
||||
*
|
||||
* - baseUrl - this setting controls how non-relative module names are resolved. If this setting is specified then non-relative
|
||||
* names will be resolved relative to baseUrl: i.e. if baseUrl is '/a/b' then canditate location to resolve module name 'c/d' will
|
||||
* names will be resolved relative to baseUrl: i.e. if baseUrl is '/a/b' then candidate location to resolve module name 'c/d' will
|
||||
* be '/a/b/c/d'
|
||||
* - paths - this setting can only be used when baseUrl is specified. allows to tune how non-relative module names
|
||||
* will be resolved based on the content of the module name.
|
||||
@@ -169,7 +169,7 @@ namespace ts {
|
||||
* If module name can be matches with multiple patterns then pattern with the longest prefix will be picked.
|
||||
* After selecting pattern we'll use list of substitutions to get candidate locations of the module and the try to load module
|
||||
* from the candidate location.
|
||||
* Substitiution is a string that can contain zero or one '*'. To get candidate location from substitution we'll pick every
|
||||
* Substitution is a string that can contain zero or one '*'. To get candidate location from substitution we'll pick every
|
||||
* substitution in the list and replace '*' with <MatchedStar> string. If candidate location is not rooted it
|
||||
* will be converted to absolute using baseUrl.
|
||||
* For example:
|
||||
@@ -197,10 +197,10 @@ namespace ts {
|
||||
* 'rootDirs' provides the way to tell compiler that in order to get the whole project it should behave as if content of all
|
||||
* root dirs were merged together.
|
||||
* I.e. for the example above 'rootDirs' will have two entries: [ '/local/src', '/shared/components/contracts/src' ].
|
||||
* Compiler wil first convert './protocols/file2' into absolute path relative to the location of containing file:
|
||||
* Compiler will first convert './protocols/file2' into absolute path relative to the location of containing file:
|
||||
* '/local/src/content/protocols/file2' and try to load it - failure.
|
||||
* Then it will search 'rootDirs' looking for a longest matching prefix of this absolute path and if such prefix is found - absolute path will
|
||||
* be converted to a path relative to found rootDir entry './content/protocols/file2' (*). As a last step compiler will check all remainining
|
||||
* be converted to a path relative to found rootDir entry './content/protocols/file2' (*). As a last step compiler will check all remaining
|
||||
* entries in 'rootDirs', use them to build absolute path out of (*) and try to resolve module from this location.
|
||||
*/
|
||||
function tryLoadModuleUsingOptionalResolutionSettings(moduleName: string, containingDirectory: string, loader: ResolutionKindSpecificLoader,
|
||||
@@ -232,7 +232,7 @@ namespace ts {
|
||||
for (const rootDir of state.compilerOptions.rootDirs) {
|
||||
// rootDirs are expected to be absolute
|
||||
// in case of tsconfig.json this will happen automatically - compiler will expand relative names
|
||||
// using locaton of tsconfig.json as base location
|
||||
// using location of tsconfig.json as base location
|
||||
let normalizedRoot = normalizePath(rootDir);
|
||||
if (!endsWith(normalizedRoot, directorySeparator)) {
|
||||
normalizedRoot += directorySeparator;
|
||||
@@ -329,7 +329,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
else if (pattern === moduleName) {
|
||||
// pattern was matched as is - no need to seatch further
|
||||
// pattern was matched as is - no need to search further
|
||||
matchedPattern = pattern;
|
||||
matchedStar = undefined;
|
||||
break;
|
||||
@@ -1025,7 +1025,7 @@ namespace ts {
|
||||
// We were canceled while performing the operation. Because our type checker
|
||||
// might be a bad state, we need to throw it away.
|
||||
//
|
||||
// Note: we are overly agressive here. We do not actually *have* to throw away
|
||||
// Note: we are overly aggressive here. We do not actually *have* to throw away
|
||||
// the "noDiagnosticsTypeChecker". However, for simplicity, i'd like to keep
|
||||
// the lifetimes of these two TypeCheckers the same. Also, we generally only
|
||||
// cancel when the user has made a change anyways. And, in that case, we (the
|
||||
@@ -1477,7 +1477,7 @@ namespace ts {
|
||||
const resolution = resolutions[i];
|
||||
setResolvedModule(file, moduleNames[i], resolution);
|
||||
// add file to program only if:
|
||||
// - resolution was successfull
|
||||
// - resolution was successful
|
||||
// - noResolve is falsy
|
||||
// - module name come from the list fo imports
|
||||
const shouldAddFile = resolution &&
|
||||
|
||||
@@ -511,7 +511,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
// All conflict markers consist of the same character repeated seven times. If it is
|
||||
// a <<<<<<< or >>>>>>> marker then it is also followd by a space.
|
||||
// a <<<<<<< or >>>>>>> marker then it is also followed by a space.
|
||||
const mergeConflictMarkerLength = "<<<<<<<".length;
|
||||
|
||||
function isConflictMarkerTrivia(text: string, pos: number) {
|
||||
@@ -551,7 +551,7 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
Debug.assert(ch === CharacterCodes.equals);
|
||||
// Consume everything from the start of the mid-conlict marker to the start of the next
|
||||
// Consume everything from the start of the mid-conflict marker to the start of the next
|
||||
// end-conflict marker.
|
||||
while (pos < len) {
|
||||
const ch = text.charCodeAt(pos);
|
||||
|
||||
+1
-1
@@ -500,7 +500,7 @@ namespace ts {
|
||||
readFile,
|
||||
writeFile,
|
||||
watchFile: (filePath, callback) => {
|
||||
// Node 4.0 stablized the `fs.watch` function on Windows which avoids polling
|
||||
// Node 4.0 stabilized the `fs.watch` function on Windows which avoids polling
|
||||
// and is more efficient than `fs.watchFile` (ref: https://github.com/nodejs/node/pull/2649
|
||||
// and https://github.com/Microsoft/TypeScript/issues/4643), therefore
|
||||
// if the current node.js version is newer than 4, use `fs.watch` instead.
|
||||
|
||||
+4
-4
@@ -115,7 +115,7 @@ namespace ts {
|
||||
const gutterStyleSequence = "\u001b[100;30m";
|
||||
const gutterSeparator = " ";
|
||||
const resetEscapeSequence = "\u001b[0m";
|
||||
const elipsis = "...";
|
||||
const ellipsis = "...";
|
||||
const categoryFormatMap: Map<string> = {
|
||||
[DiagnosticCategory.Warning]: yellowForegroundEscapeSequence,
|
||||
[DiagnosticCategory.Error]: redForegroundEscapeSequence,
|
||||
@@ -139,7 +139,7 @@ namespace ts {
|
||||
const hasMoreThanFiveLines = (lastLine - firstLine) >= 4;
|
||||
let gutterWidth = (lastLine + 1 + "").length;
|
||||
if (hasMoreThanFiveLines) {
|
||||
gutterWidth = Math.max(elipsis.length, gutterWidth);
|
||||
gutterWidth = Math.max(ellipsis.length, gutterWidth);
|
||||
}
|
||||
|
||||
output += sys.newLine;
|
||||
@@ -147,7 +147,7 @@ namespace ts {
|
||||
// If the error spans over 5 lines, we'll only show the first 2 and last 2 lines,
|
||||
// so we'll skip ahead to the second-to-last line.
|
||||
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
|
||||
output += formatAndReset(padLeft(elipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + sys.newLine;
|
||||
output += formatAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + sys.newLine;
|
||||
i = lastLine - 1;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ namespace ts {
|
||||
const directory = ts.getDirectoryPath(configFileName);
|
||||
directoryWatcher = sys.watchDirectory(
|
||||
// When the configFileName is just "tsconfig.json", the watched directory should be
|
||||
// the current direcotry; if there is a given "project" parameter, then the configFileName
|
||||
// the current directory; if there is a given "project" parameter, then the configFileName
|
||||
// is an absolute file name.
|
||||
directory == "" ? "." : directory,
|
||||
watchedDirectoryChanged, /*recursive*/ true);
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace ts {
|
||||
node.flags |= NodeFlags.ThisNodeOrAnySubNodesHasError;
|
||||
}
|
||||
|
||||
// Also mark that we've propogated the child information to this node. This way we can
|
||||
// Also mark that we've propagated the child information to this node. This way we can
|
||||
// always consult the bit directly on this node without needing to check its children
|
||||
// again.
|
||||
node.flags |= NodeFlags.HasAggregatedChildData;
|
||||
@@ -2586,7 +2586,7 @@ namespace ts {
|
||||
byte4 = 64;
|
||||
}
|
||||
|
||||
// Write to the ouput
|
||||
// Write to the output
|
||||
result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4);
|
||||
|
||||
i += 3;
|
||||
@@ -2781,9 +2781,9 @@ namespace ts {
|
||||
// . | \
|
||||
// ----------------------------------------------------------------------*--------------------------------
|
||||
//
|
||||
// (Note the dots represent the newly inferrred start.
|
||||
// (Note the dots represent the newly inferred start.
|
||||
// Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
|
||||
// absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
|
||||
// absolute positions at the asterisks, and the relative change between the dollar signs. Basically, we see
|
||||
// which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
|
||||
// means:
|
||||
//
|
||||
@@ -2806,8 +2806,8 @@ namespace ts {
|
||||
// ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
|
||||
// that's the same as if we started at char 80 instead of 60.
|
||||
//
|
||||
// As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
|
||||
// than pusing the first edit forward to match the second, we'll push the second edit forward to match the
|
||||
// As it so happens, the same logic applies if the second edit precedes the first edit. In that case rather
|
||||
// than pushing the first edit forward to match the second, we'll push the second edit forward to match the
|
||||
// first.
|
||||
//
|
||||
// In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
|
||||
|
||||
Reference in New Issue
Block a user