Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
Merge 9642e50 into 8b67f4a
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed May 24, 2020
2 parents 8b67f4a + 9642e50 commit 8320ccd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/common.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Details } from "./gem";
import { Cache, Details } from "./types";

export const cache: Map<string, Details> = new Map();
export const cache: Cache = new Map<string, Details>();
7 changes: 2 additions & 5 deletions src/extractDependency.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
interface Dependency {
name: string;
requirements: string | undefined;
}
import { Dependency } from "./types";

function quoteMapper(line: string): string {
const quoteIndex = line.indexOf("'");
Expand All @@ -24,7 +21,7 @@ export function extractDependency(line: string): Dependency | undefined {
const parts = mapped
.trim()
.split(",")
.map(s => s.trim().replace(/'|"/g, ""));
.map((s) => s.trim().replace(/'|"/g, ""));

if (parts.length >= 1) {
const name = parts[0];
Expand Down
6 changes: 1 addition & 5 deletions src/gem.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import axios from "axios";

export interface Details {
version: string;
info: string;
homepage_uri: string;
}
import { Details } from "./types";

export class Gem {
name: string;
Expand Down
3 changes: 2 additions & 1 deletion src/providers/abstractProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import * as vscode from "vscode";

import { cache } from "../common";
import { extractDependency } from "../extractDependency";
import { Details,Gem } from "../gem";
import { Gem } from "../gem";
import { Details } from "../types";

export class AbstractProvider implements vscode.HoverProvider {
public async provideHover(
Expand Down
12 changes: 12 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export interface Details {
version: string;
info: string;
homepage_uri: string;
}

export interface Dependency {
name: string;
requirements: string | undefined;
}

export type Cache = Map<string, Details>;

0 comments on commit 8320ccd

Please sign in to comment.