mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] yarn format
This commit is contained in:
parent
4834c090f8
commit
5c1f949953
3 changed files with 6 additions and 8 deletions
|
@ -98,22 +98,20 @@ export class AstroPlugin implements CompletionsProvider, FoldingRangeProvider {
|
|||
}
|
||||
|
||||
const specifier = this.getImportSpecifierForIdentifier(sourceFile, componentName);
|
||||
if(!specifier) {
|
||||
if (!specifier) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const defs = lang.getDefinitionAtPosition(tsFilePath, specifier.getStart());
|
||||
if(!defs) {
|
||||
if (!defs) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const tsFragment = await tsDoc.getFragment();
|
||||
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);
|
||||
return LocationLink.create(
|
||||
pathToUrl(defFilePath), startRange, startRange
|
||||
);
|
||||
return LocationLink.create(pathToUrl(defFilePath), startRange, startRange);
|
||||
});
|
||||
|
||||
return links;
|
||||
|
|
|
@ -36,7 +36,7 @@ export class TypeScriptPlugin implements CompletionsProvider {
|
|||
}
|
||||
|
||||
async getDefinitions(document: Document, position: Position): Promise<DefinitionLink[]> {
|
||||
if(!this.isInsideFrontmatter(document, position)) {
|
||||
if (!this.isInsideFrontmatter(document, position)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue