move types from snippets to static

This commit is contained in:
Jacob Kim 2025-06-28 19:55:42 -07:00
parent 408038275d
commit 4e9690e058
2 changed files with 14 additions and 11 deletions

View file

@ -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[]>;
}

View file

@ -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 =