-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patharchitecture.puml
82 lines (64 loc) · 2.25 KB
/
architecture.puml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@startuml Architecture
class Extension {
+ activate()
+ deactivate()
- _onCreateDocument()
- _onSaveDocument()
- _excuteCommand()
}
Extension --> FileheaderManager
FileheaderManager --> FeatureProviderLoader
FeatureProviderLoader o-- IFileheaderLanguageProvider
class FileheaderManager {
- _providers: Array<IFileheaderLanguageProvider>
- _loadProviders(): Promise<void>
- _isSupportedLanguage(languageId: string): boolean
- _hasExistingFileheader(): boolean
+ updateFileheader(document: TextDocument): Promise<void>
}
FileheaderManager -- FileheaderVariableBuilder
FileheaderManager -- ExtensionConfigManager
class FeatureProviderLoader {
+ load(): Array<IFileheaderLanguageProvider>
- _loadCustomProviders(): Array<IFileheaderLanguageProvider>
}
abstract class IFileheaderLanguageProvider {
+ languages: Array<string>
+ {abstract} getTemplate(tpl: ITemplateFunction, variables: IFileheaderVariables): Tuple<Array<string>, Array<string>>
+ getFileheader(variables: IFileheaderVariables): string
}
IFileheaderLanguageProvider --> FileheaderVariableBuilder
IFileheaderLanguageProvider -> ITemplateFunction
class TypescriptProvider implements IFileheaderLanguageProvider {
}
class PythonProvider implements IFileheaderLanguageProvider {
}
interface IFileheaderVariables {
+ ctime: Date
+ mtime: Date
+ author: string
+ authorEmail: string
+ dateFormant?: string
}
interface ITemplateFunction {
+ (strings: Array<string>, interpolations: Array<any>): Tuple<Array<string>, Array<string>>
}
class FileheaderVariableBuilder {
+ {static} build(config: vscode.WorkspaceConfiguration): FileheaderVariables
}
class ExtensionConfigManager {
get(): vscode.WorkspaceConfiguration
set(): Promise<void>
}
IFileheaderLanguageProvider --> IFileheaderVariables
class Utils {
{static} hasShebang(document: TextDocument): boolean
{static} getTaggedTemplateInputs(strings: Array<string>, ...inteplations: Array<any>): Tuple<Array<string>, Array<any>>
}
FileheaderVariableBuilder --> CanNotGetAuthorError
FileheaderVariableBuilder --> CanNotGetEmailError
FileheaderVariableBuilder --> ExtensionConfigManager
class Error {}
class GetAuthorError extends Error {}
class GetEmailError extends Error {}
@enduml