-
Notifications
You must be signed in to change notification settings - Fork 0
/
language-service-interface.ts
40 lines (36 loc) · 1.03 KB
/
language-service-interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import * as util from './util.ts'
export type PathFilters = {
includeFilters: RegExp[],
excludeFilters: RegExp[]
}
export type ParseContext = {
pathFilters: PathFilters,
rootDir: string,
files: string[],
currentFile: string,
fileContent: string,
lineNumber: number,
line: string,
nameResolver: (name: string) => string | null
// deno-lint-ignore no-explicit-any
languageOption: any,
// deno-lint-ignore no-explicit-any
debugOutput: (...data: any[]) => void
}
export type StringPair = [string, string]
export type Dependencies = {[id:string]: string[]}
export interface LanguageService {
name: string
exts: string[]
desc?: string
moduleSeparator?: string
parseSingleLine?(context: ParseContext): Dependencies
parse?(context: ParseContext): Dependencies
getResolveCandidates?(f: string): string[]
}
export type DependencyData = {
dependencies: Dependencies,
contains: util.RecursiveObject,
flatDependencies: StringPair[],
flatContains: StringPair[]
}