move types from snippets to static
This commit is contained in:
parent
408038275d
commit
4e9690e058
2 changed files with 14 additions and 11 deletions
|
|
@ -2,12 +2,12 @@ import { Tree } from "web-tree-sitter";
|
|||
import { Range } from "../../..";
|
||||
|
||||
export interface TypeSpanAndSourceFile {
|
||||
typeSpan: string,
|
||||
sourceFile: string,
|
||||
typeSpan: string;
|
||||
sourceFile: string;
|
||||
}
|
||||
|
||||
export interface TypeSpanAndSourceFileAndAst extends TypeSpanAndSourceFile {
|
||||
ast: Tree
|
||||
ast: Tree;
|
||||
}
|
||||
|
||||
export interface HoleContext {
|
||||
|
|
@ -21,3 +21,12 @@ export interface HoleContext {
|
|||
export type RelevantTypes = Map<string, TypeSpanAndSourceFileAndAst>;
|
||||
export type RelevantHeaders = Set<TypeSpanAndSourceFile>;
|
||||
|
||||
export type Filepath = string;
|
||||
export type RelevantType = string;
|
||||
export type RelevantHeader = string;
|
||||
|
||||
export interface StaticContext {
|
||||
holeType: string;
|
||||
relevantTypes: Map<Filepath, RelevantType[]>;
|
||||
relevantHeaders: Map<Filepath, RelevantHeader[]>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ export enum AutocompleteSnippetType {
|
|||
Code = "code",
|
||||
Diff = "diff",
|
||||
Clipboard = "clipboard",
|
||||
Static = "static",
|
||||
}
|
||||
|
||||
interface BaseAutocompleteSnippet {
|
||||
|
|
@ -23,15 +24,8 @@ export interface AutocompleteClipboardSnippet extends BaseAutocompleteSnippet {
|
|||
copiedAt: string;
|
||||
}
|
||||
|
||||
type Filepath = string;
|
||||
type RelevantType = string;
|
||||
type RelevantHeader = string;
|
||||
|
||||
export interface AutocompleteStaticSnippet extends BaseAutocompleteSnippet {
|
||||
type: AutocompleteSnippetType.Code;
|
||||
holeType: string,
|
||||
relevantTypes: Map<Filepath, RelevantType[]>,
|
||||
relevantHeaders: Map<Filepath, RelevantHeader[]>
|
||||
type: AutocompleteSnippetType.Static;
|
||||
}
|
||||
|
||||
export type AutocompleteSnippet =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue