[ci] yarn format

This commit is contained in:
matthewp 2021-05-20 19:15:34 +00:00 committed by GitHub Actions
parent 4834c090f8
commit 5c1f949953
3 changed files with 6 additions and 8 deletions

View file

@ -98,22 +98,20 @@ export class AstroPlugin implements CompletionsProvider, FoldingRangeProvider {
} }
const specifier = this.getImportSpecifierForIdentifier(sourceFile, componentName); const specifier = this.getImportSpecifierForIdentifier(sourceFile, componentName);
if(!specifier) { if (!specifier) {
return []; return [];
} }
const defs = lang.getDefinitionAtPosition(tsFilePath, specifier.getStart()); const defs = lang.getDefinitionAtPosition(tsFilePath, specifier.getStart());
if(!defs) { if (!defs) {
return []; return [];
} }
const tsFragment = await tsDoc.getFragment(); const tsFragment = await tsDoc.getFragment();
const startRange: Range = Range.create(Position.create(0, 0), Position.create(0, 0)); const startRange: Range = Range.create(Position.create(0, 0), Position.create(0, 0));
const links = defs.map(def => { const links = defs.map((def) => {
const defFilePath = ensureRealFilePath(def.fileName); const defFilePath = ensureRealFilePath(def.fileName);
return LocationLink.create( return LocationLink.create(pathToUrl(defFilePath), startRange, startRange);
pathToUrl(defFilePath), startRange, startRange
);
}); });
return links; return links;

View file

@ -36,7 +36,7 @@ export class TypeScriptPlugin implements CompletionsProvider {
} }
async getDefinitions(document: Document, position: Position): Promise<DefinitionLink[]> { async getDefinitions(document: Document, position: Position): Promise<DefinitionLink[]> {
if(!this.isInsideFrontmatter(document, position)) { if (!this.isInsideFrontmatter(document, position)) {
return []; return [];
} }

View file

@ -233,4 +233,4 @@ function append(result: string, str: string, n: number): string {
str += str; str += str;
} }
return result; return result;
} }