From 7c57293bee14d5a248094a3fbde1aed35a43fd70 Mon Sep 17 00:00:00 2001 From: WilliamKoza Date: Mon, 4 Mar 2019 15:46:18 +0100 Subject: [PATCH] refactor(language-service): clean up imports language-service and misspellings in public API (#29097) PR Close #29097 --- packages/language-service/src/completions.ts | 8 ++++---- .../language-service/src/locate_symbol.ts | 4 ++-- .../language-service/src/reflector_host.ts | 2 +- packages/language-service/src/types.ts | 20 +++++++++---------- .../language-service/src/typescript_host.ts | 6 ++---- packages/language-service/src/utils.ts | 2 +- 6 files changed, 19 insertions(+), 23 deletions(-) diff --git a/packages/language-service/src/completions.ts b/packages/language-service/src/completions.ts index 22941debd2..5a663bd045 100644 --- a/packages/language-service/src/completions.ts +++ b/packages/language-service/src/completions.ts @@ -6,13 +6,13 @@ * found in the LICENSE file at https://angular.io/license */ -import {AST, AstPath, AttrAst, Attribute, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, CssSelector, DirectiveAst, Element, ElementAst, EmbeddedTemplateAst, ImplicitReceiver, NAMED_ENTITIES, NgContentAst, Node as HtmlAst, NullTemplateVisitor, ParseSpan, PropertyRead, ReferenceAst, SelectorMatcher, TagContentType, TemplateAst, TemplateAstVisitor, Text, TextAst, VariableAst, findNode, getHtmlTagDefinition, splitNsName, templateVisitAll} from '@angular/compiler'; -import {DiagnosticTemplateInfo, getExpressionScope} from '@angular/compiler-cli/src/language_services'; +import {AST, AstPath, Attribute, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, CssSelector, Element, ElementAst, ImplicitReceiver, NAMED_ENTITIES, Node as HtmlAst, NullTemplateVisitor, ParseSpan, PropertyRead, SelectorMatcher, TagContentType, Text, findNode, getHtmlTagDefinition, splitNsName} from '@angular/compiler'; +import {getExpressionScope} from '@angular/compiler-cli/src/language_services'; -import {AstResult, AttrInfo, SelectorInfo, TemplateInfo} from './common'; +import {AttrInfo, TemplateInfo} from './common'; import {getExpressionCompletions} from './expressions'; import {attributeNames, elementNames, eventNames, propertyNames} from './html_info'; -import {BuiltinType, Completion, Completions, Span, Symbol, SymbolDeclaration, SymbolTable, TemplateSource} from './types'; +import {Completion, Completions, Span, Symbol, SymbolTable, TemplateSource} from './types'; import {diagnosticInfoFromTemplateInfo, findTemplateAstAt, flatten, getSelectors, hasTemplateReference, inSpan, removeSuffix, spanOf, uniqueByName} from './utils'; const TEMPLATE_ATTR_PREFIX = '*'; diff --git a/packages/language-service/src/locate_symbol.ts b/packages/language-service/src/locate_symbol.ts index a87750716d..fd07d095d2 100644 --- a/packages/language-service/src/locate_symbol.ts +++ b/packages/language-service/src/locate_symbol.ts @@ -6,12 +6,12 @@ * found in the LICENSE file at https://angular.io/license */ -import {AST, Attribute, BoundDirectivePropertyAst, BoundEventAst, ElementAst, TemplateAst, TemplateAstPath, findNode, tokenReference} from '@angular/compiler'; +import {AST, Attribute, BoundDirectivePropertyAst, BoundEventAst, ElementAst, TemplateAstPath, findNode, tokenReference} from '@angular/compiler'; import {getExpressionScope} from '@angular/compiler-cli/src/language_services'; import {TemplateInfo} from './common'; import {getExpressionSymbol} from './expressions'; -import {Definition, Location, Span, Symbol, SymbolTable} from './types'; +import {Definition, Span, Symbol} from './types'; import {diagnosticInfoFromTemplateInfo, findTemplateAstAt, inSpan, offsetSpan, spanOf} from './utils'; export interface SymbolInfo { diff --git a/packages/language-service/src/reflector_host.ts b/packages/language-service/src/reflector_host.ts index 42df27c8cc..dcf66f2fae 100644 --- a/packages/language-service/src/reflector_host.ts +++ b/packages/language-service/src/reflector_host.ts @@ -7,7 +7,7 @@ */ import {StaticSymbolResolverHost} from '@angular/compiler'; -import {CompilerOptions, MetadataCollector, MetadataReaderCache, MetadataReaderHost, createMetadataReaderCache, readMetadata} from '@angular/compiler-cli/src/language_services'; +import {CompilerOptions, MetadataCollector, MetadataReaderHost, createMetadataReaderCache, readMetadata} from '@angular/compiler-cli/src/language_services'; import * as path from 'path'; import * as ts from 'typescript'; diff --git a/packages/language-service/src/types.ts b/packages/language-service/src/types.ts index a3ab763725..d12d836903 100644 --- a/packages/language-service/src/types.ts +++ b/packages/language-service/src/types.ts @@ -27,7 +27,7 @@ export { * The information `LanguageService` needs from the `LanguageServiceHost` to describe the content of * a template and the language context the template is in. * - * A host interface; see `LanguageSeriviceHost`. + * A host interface; see `LanguageServiceHost`. * * @publicApi */ @@ -71,7 +71,7 @@ export interface TemplateSource { /** * A sequence of template sources. * - * A host type; see `LanguageSeriviceHost`. + * A host type; see `LanguageServiceHost`. * * @publicApi */ @@ -102,12 +102,12 @@ export interface DeclarationError { * Information about the component declarations. * * A file might contain a declaration without a template because the file contains only - * templateUrl references. However, the compoennt declaration might contain errors that + * templateUrl references. However, the component declaration might contain errors that * need to be reported such as the template string is missing or the component is not * declared in a module. These error should be reported on the declaration, not the * template. * - * A host type; see `LanguageSeriviceHost`. + * A host type; see `LanguageServiceHost`. * * @publicApi */ @@ -137,7 +137,7 @@ export interface Declaration { /** * A sequence of declarations. * - * A host type; see `LanguageSeriviceHost`. + * A host type; see `LanguageServiceHost`. * * @publicApi */ @@ -145,8 +145,7 @@ export type Declarations = Declaration[]; /** * The host for a `LanguageService`. This provides all the `LanguageService` requires to respond - * to - * the `LanguageService` requests. + * to the `LanguageService` requests. * * This interface describes the requirements of the `LanguageService` on its host. * @@ -186,8 +185,7 @@ export interface LanguageServiceHost { /** * Return the template source information for all templates in `fileName` or for `fileName` if - * it - * is a template file. + * it is a template file. */ getTemplates(fileName: string): TemplateSources; @@ -216,7 +214,7 @@ export interface LanguageServiceHost { */ export interface Completion { /** - * The kind of comletion. + * The kind of completion. */ kind: DeclarationKind; @@ -353,7 +351,7 @@ export interface Hover { * beginning of the file reference by `fileName`. * * This interface and all interfaces and types marked as `LanguageService` types, describe a - * particlar implementation of the Angular language service and is not intented to be + * particular implementation of the Angular language service and is not intended to be * implemented. Adding members to the interface will not be considered a breaking change as * defined by SemVer. * diff --git a/packages/language-service/src/typescript_host.ts b/packages/language-service/src/typescript_host.ts index ec1d3c7f87..b5a26f7fcc 100644 --- a/packages/language-service/src/typescript_host.ts +++ b/packages/language-service/src/typescript_host.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {AotSummaryResolver, CompileMetadataResolver, CompilerConfig, DEFAULT_INTERPOLATION_CONFIG, DirectiveNormalizer, DirectiveResolver, DomElementSchemaRegistry, FormattedError, FormattedMessageChain, HtmlParser, InterpolationConfig, JitSummaryResolver, NgAnalyzedModules, NgModuleResolver, ParseTreeResult, PipeResolver, ResourceLoader, StaticReflector, StaticSymbol, StaticSymbolCache, StaticSymbolResolver, SummaryResolver, analyzeNgModules, createOfflineCompileUrlResolver, isFormattedError} from '@angular/compiler'; +import {AotSummaryResolver, CompileMetadataResolver, CompilerConfig, DEFAULT_INTERPOLATION_CONFIG, DirectiveNormalizer, DirectiveResolver, DomElementSchemaRegistry, FormattedError, FormattedMessageChain, HtmlParser, InterpolationConfig, JitSummaryResolver, NgAnalyzedModules, NgModuleResolver, ParseTreeResult, PipeResolver, ResourceLoader, StaticReflector, StaticSymbol, StaticSymbolCache, StaticSymbolResolver, analyzeNgModules, createOfflineCompileUrlResolver, isFormattedError} from '@angular/compiler'; import {CompilerOptions, getClassMembersFromDeclaration, getPipesTable, getSymbolQuery} from '@angular/compiler-cli/src/language_services'; import {ViewEncapsulation, ɵConsole as Console} from '@angular/core'; import * as fs from 'fs'; @@ -15,9 +15,7 @@ import * as ts from 'typescript'; import {createLanguageService} from './language_service'; import {ReflectorHost} from './reflector_host'; -import {BuiltinType, Declaration, DeclarationError, DeclarationKind, Declarations, Definition, DiagnosticMessageChain, LanguageService, LanguageServiceHost, PipeInfo, Pipes, Signature, Span, Symbol, SymbolDeclaration, SymbolQuery, SymbolTable, TemplateSource, TemplateSources} from './types'; -import {isTypescriptVersion} from './utils'; - +import {Declaration, DeclarationError, Declarations, DiagnosticMessageChain, LanguageService, LanguageServiceHost, Span, Symbol, SymbolQuery, TemplateSource, TemplateSources} from './types'; /** diff --git a/packages/language-service/src/utils.ts b/packages/language-service/src/utils.ts index d9914d8c7d..839e437f13 100644 --- a/packages/language-service/src/utils.ts +++ b/packages/language-service/src/utils.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {AstPath, CompileDirectiveSummary, CompileTypeMetadata, CssSelector, DirectiveAst, ElementAst, EmbeddedTemplateAst, HtmlAstPath, Node as HtmlNode, ParseSourceSpan, RecursiveTemplateAstVisitor, RecursiveVisitor, TemplateAst, TemplateAstPath, identifierName, templateVisitAll, visitAll} from '@angular/compiler'; +import {AstPath, CompileDirectiveSummary, CompileTypeMetadata, CssSelector, DirectiveAst, ElementAst, EmbeddedTemplateAst, ParseSourceSpan, RecursiveTemplateAstVisitor, TemplateAst, TemplateAstPath, identifierName, templateVisitAll} from '@angular/compiler'; import {DiagnosticTemplateInfo} from '@angular/compiler-cli/src/language_services'; import * as ts from 'typescript';