@px-lsp/server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +334 -0
- package/THIRD-PARTY-NOTICES.md +83 -0
- package/data/ck3/dataTypes.json +2195 -0
- package/data/ck3/data_types/data_types_common.txt +2040 -0
- package/data/ck3/data_types/data_types_gui.txt +5264 -0
- package/data/ck3/data_types/data_types_internalclausewitzgui.txt +14843 -0
- package/data/ck3/data_types/data_types_script.txt +4251 -0
- package/data/ck3/data_types/data_types_uncategorized.txt +109984 -0
- package/data/ck3/freqs.json +1 -0
- package/data/ck3/guiSchema.json +6344 -0
- package/data/ck3/script_docs/effects.log +16059 -0
- package/data/ck3/script_docs/event_targets.log +2098 -0
- package/data/ck3/script_docs/modifiers.log +2228 -0
- package/data/ck3/script_docs/on_actions.log +5275 -0
- package/data/ck3/script_docs/triggers.log +11991 -0
- package/data/ck3/structures.json +9743 -0
- package/data/ck3/wikidocs/ATTRIBUTION.md +18 -0
- package/data/ck3/wikidocs/Data_types.md +2568 -0
- package/data/ck3/wikidocs/Effects_list.md +1176 -0
- package/data/ck3/wikidocs/Scopes_list.md +341 -0
- package/data/ck3/wikidocs/Triggers_list.md +1097 -0
- package/data/eu5/data_types/data_types_common.txt +2087 -0
- package/data/eu5/data_types/data_types_gui.txt +6732 -0
- package/data/eu5/data_types/data_types_internalclausewitzgui.txt +19276 -0
- package/data/eu5/data_types/data_types_script.txt +5688 -0
- package/data/eu5/data_types/data_types_uncategorized.txt +135569 -0
- package/data/vic3/data_types/data_types_common.txt +2021 -0
- package/data/vic3/data_types/data_types_gui.txt +5592 -0
- package/data/vic3/data_types/data_types_internalclausewitzgui.txt +17304 -0
- package/data/vic3/data_types/data_types_script.txt +2817 -0
- package/data/vic3/data_types/data_types_uncategorized.txt +84354 -0
- package/data/vic3/freqs.json +1 -0
- package/data/vic3/guiSchema.json +5578 -0
- package/data/vic3/script_docs/effects.log +38135 -0
- package/data/vic3/script_docs/event_targets.log +2028 -0
- package/data/vic3/script_docs/modifiers.log +18954 -0
- package/data/vic3/script_docs/on_actions.log +1561 -0
- package/data/vic3/script_docs/triggers.log +15738 -0
- package/data/vic3/structures.json +10189 -0
- package/dist/server.js +63668 -0
- package/media/px-lsp.svg +12 -0
- package/package.json +50 -0
- package/src/clientMode.ts +60 -0
- package/src/coa/coa.ts +184 -0
- package/src/coa/coaParse.ts +267 -0
- package/src/context.ts +78 -0
- package/src/contextKeywords.ts +224 -0
- package/src/data/dataBindingMacros.ts +82 -0
- package/src/data/dataFnDocs.ts +152 -0
- package/src/data/dataFnUsage.ts +431 -0
- package/src/data/dataTypes.ts +279 -0
- package/src/data/defines.ts +123 -0
- package/src/data/docsParser.ts +453 -0
- package/src/data/keywordDocs.ts +98 -0
- package/src/data/modifierTemplates.ts +143 -0
- package/src/data/textFormatting.ts +165 -0
- package/src/data/wikiDocs.ts +187 -0
- package/src/dds/decoder.ts +1007 -0
- package/src/dds/encode.ts +235 -0
- package/src/dds/index.ts +58 -0
- package/src/dds/png.ts +96 -0
- package/src/dds/tga.ts +62 -0
- package/src/documents.ts +35 -0
- package/src/features/assetPaths.ts +169 -0
- package/src/features/codeActions.ts +148 -0
- package/src/features/colors.ts +244 -0
- package/src/features/completion.ts +961 -0
- package/src/features/datafunction.ts +729 -0
- package/src/features/definition.ts +84 -0
- package/src/features/diagnostics.ts +244 -0
- package/src/features/folding.ts +106 -0
- package/src/features/formatting.ts +60 -0
- package/src/features/guiLanguage.ts +366 -0
- package/src/features/guiNavigation.ts +140 -0
- package/src/features/guiTree.ts +97 -0
- package/src/features/hover.ts +817 -0
- package/src/features/hoverRender.ts +222 -0
- package/src/features/inlayHints.ts +147 -0
- package/src/features/locFormatting.ts +127 -0
- package/src/features/references.ts +70 -0
- package/src/features/rename.ts +135 -0
- package/src/features/scopeAt.ts +65 -0
- package/src/features/semanticTokens.ts +188 -0
- package/src/features/signatureHelp.ts +72 -0
- package/src/features/symbols.ts +241 -0
- package/src/features/textureHover.ts +143 -0
- package/src/features/workspaceSymbols.ts +69 -0
- package/src/games/active.ts +19 -0
- package/src/games/ck3/ambientScopes.ts +273 -0
- package/src/games/ck3/index.ts +38 -0
- package/src/games/ck3/meta.ts +28 -0
- package/src/games/ck3/modifierPlaceholders.ts +61 -0
- package/src/games/ck3/saveSchema.ts +134 -0
- package/src/games/ck3/scaffolds.ts +197 -0
- package/src/games/ck3/schema.ts +422 -0
- package/src/games/ck3/structures.ts +887 -0
- package/src/games/eu5/index.ts +75 -0
- package/src/games/eu5/meta.ts +44 -0
- package/src/games/eu5/scaffolds.ts +49 -0
- package/src/games/eu5/schema.generated.ts +1043 -0
- package/src/games/jomini/variables.ts +134 -0
- package/src/games/profile.ts +205 -0
- package/src/games/registry.ts +27 -0
- package/src/games/vic3/index.ts +52 -0
- package/src/games/vic3/meta.ts +55 -0
- package/src/games/vic3/saveSchema.ts +77 -0
- package/src/games/vic3/scaffolds.ts +135 -0
- package/src/games/vic3/schema.ts +650 -0
- package/src/games/vic3/structures.ts +33 -0
- package/src/gui/anchorSpec.ts +66 -0
- package/src/gui/declMarkers.ts +30 -0
- package/src/gui/fillGeometry.ts +101 -0
- package/src/gui/guiDefs.ts +386 -0
- package/src/gui/guiDependencies.ts +352 -0
- package/src/gui/guiLinks.ts +64 -0
- package/src/gui/layoutEngine.ts +1998 -0
- package/src/gui/layoutService.ts +221 -0
- package/src/gui/measuredMetrics.ts +21 -0
- package/src/gui/previewService.ts +89 -0
- package/src/gui/saveSchema.ts +220 -0
- package/src/gui/saveValues.ts +399 -0
- package/src/gui/saveZip.ts +60 -0
- package/src/gui/sourceEdit.ts +535 -0
- package/src/gui/sourceEditService.ts +439 -0
- package/src/gui/sourceModel.ts +603 -0
- package/src/gui/textResolve.ts +145 -0
- package/src/gui/textureInfo.ts +106 -0
- package/src/gui/vocabulary.ts +149 -0
- package/src/gui/widgetEdit.ts +52 -0
- package/src/gui/widgetInfo.ts +245 -0
- package/src/index/docComments.ts +103 -0
- package/src/index/extract.ts +252 -0
- package/src/index/indexer.ts +369 -0
- package/src/index/intern.ts +101 -0
- package/src/index/lazyRefs.ts +145 -0
- package/src/index/modOrigin.ts +69 -0
- package/src/index/references.ts +534 -0
- package/src/overview/dependencies.ts +240 -0
- package/src/overview/eventBanner.ts +95 -0
- package/src/overview/eventDetail.ts +482 -0
- package/src/overview/eventGraph.ts +617 -0
- package/src/overview/eventVocabulary.ts +214 -0
- package/src/overview/locCoverage.ts +138 -0
- package/src/overview/modOverview.ts +29 -0
- package/src/overview/overrides.ts +89 -0
- package/src/parseCache.ts +81 -0
- package/src/parser/cst.ts +257 -0
- package/src/parser/encoding.ts +106 -0
- package/src/parser/index.ts +7 -0
- package/src/parser/lexer.ts +245 -0
- package/src/parser/locParser.ts +276 -0
- package/src/parser/parser.ts +360 -0
- package/src/schema/freqs.ts +70 -0
- package/src/schema/loader.ts +113 -0
- package/src/schema/types.ts +142 -0
- package/src/scopes/inference.ts +478 -0
- package/src/scopes/model.ts +148 -0
- package/src/scopes/varTypes.ts +290 -0
- package/src/server.ts +1894 -0
- package/src/serverData.ts +98 -0
- package/src/structure.ts +56 -0
- package/src/wordAt.ts +49 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Victoria 3 "New Content" templates, written from the live 1.13 install
|
|
3
|
+
* (game/events/acceptance_events.txt, game/common/on_actions/) and the workshop
|
|
4
|
+
* corpus (Community Mod Framework's events/ and common/on_actions/). Only
|
|
5
|
+
* content types verified there are offered: decisions and character
|
|
6
|
+
* interactions exist in Vic3 too, but their vanilla shape is unlike CK3's and
|
|
7
|
+
* has not been transcribed, so the command does not guess one.
|
|
8
|
+
*
|
|
9
|
+
* Tabs for indentation and LF only; the writer converts EOL and adds the BOM.
|
|
10
|
+
*/
|
|
11
|
+
import type { ScaffoldTemplate } from "../profile";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Vanilla on_actions worth hooking. Each name checked against
|
|
15
|
+
* game/common/on_actions/00_code_on_actions.txt; the trailing scope word is the
|
|
16
|
+
* root the effect runs on (`_country`, `_character`, `_state`).
|
|
17
|
+
*/
|
|
18
|
+
const VIC3_ON_ACTIONS = [
|
|
19
|
+
"on_game_started",
|
|
20
|
+
"on_game_started_after_lobby",
|
|
21
|
+
"on_monthly_pulse_country",
|
|
22
|
+
"on_yearly_pulse_country",
|
|
23
|
+
"on_five_year_pulse_country",
|
|
24
|
+
"on_monthly_pulse_character",
|
|
25
|
+
"on_yearly_pulse_state",
|
|
26
|
+
"on_character_creation",
|
|
27
|
+
"on_character_death",
|
|
28
|
+
"on_new_ruler",
|
|
29
|
+
"on_battle_won",
|
|
30
|
+
"on_building_built",
|
|
31
|
+
"on_acquired_technology",
|
|
32
|
+
"on_diplomatic_play_started",
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export const VIC3_SCAFFOLDS: ScaffoldTemplate[] = [
|
|
36
|
+
{
|
|
37
|
+
id: "event",
|
|
38
|
+
label: "$(zap) Event",
|
|
39
|
+
detail: "events/<prefix>_events.txt (+ loc stubs)",
|
|
40
|
+
nameLabel: "event id",
|
|
41
|
+
nameKind: "eventId",
|
|
42
|
+
scriptPath: "events/$PREFIX$_events.txt",
|
|
43
|
+
requiredHeader: "namespace = $PREFIX$",
|
|
44
|
+
cursorMarker: "# effects that run when the event fires",
|
|
45
|
+
// Country event shaped after vanilla acceptance_events.1: the loc keys are
|
|
46
|
+
// `<id>.t/.d/.f/.a` (dots, unlike CK3's underscores), and an option needs
|
|
47
|
+
// `default_option` on exactly one entry.
|
|
48
|
+
block: `$NAME$ = {
|
|
49
|
+
type = country_event
|
|
50
|
+
placement = root
|
|
51
|
+
|
|
52
|
+
title = $NAME$.t
|
|
53
|
+
desc = $NAME$.d
|
|
54
|
+
flavor = $NAME$.f
|
|
55
|
+
|
|
56
|
+
duration = 3
|
|
57
|
+
|
|
58
|
+
trigger = {
|
|
59
|
+
# conditions under which this event can fire
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
immediate = {
|
|
63
|
+
# effects that run when the event fires
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
option = {
|
|
67
|
+
default_option = yes
|
|
68
|
+
name = $NAME$.a
|
|
69
|
+
# effects for this option
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`,
|
|
73
|
+
locPath: "localization/$LANG$/$PREFIX$_events_l_$LANG$.yml",
|
|
74
|
+
locBody: ` $NAME$.t:0 "$NAME$ title"
|
|
75
|
+
$NAME$.d:0 "$NAME$ description"
|
|
76
|
+
$NAME$.f:0 "$NAME$ flavor text"
|
|
77
|
+
$NAME$.a:0 "Option text"
|
|
78
|
+
`,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "on_action",
|
|
82
|
+
label: "$(git-merge) on_action hook",
|
|
83
|
+
detail: "common/on_actions/ (append pattern, no override)",
|
|
84
|
+
nameLabel: "vanilla on_action",
|
|
85
|
+
nameKind: "identifier",
|
|
86
|
+
picks: VIC3_ON_ACTIONS,
|
|
87
|
+
// Plural folder here, unlike CK3's common/on_action/.
|
|
88
|
+
scriptPath: "common/on_actions/$PREFIX$_on_actions.txt",
|
|
89
|
+
cursorMarker: "# your effects here",
|
|
90
|
+
// The APPEND pattern, same as vanilla's own on_monthly_pulse: add a
|
|
91
|
+
// mod-owned on_action to the vanilla one's `on_actions` list instead of
|
|
92
|
+
// redefining the vanilla block, which would override it for every mod.
|
|
93
|
+
block: `$NAME$ = {
|
|
94
|
+
on_actions = { $PREFIX$_$NAME$ }
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
$PREFIX$_$NAME$ = {
|
|
98
|
+
effect = {
|
|
99
|
+
# your effects here
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "scripted_effect",
|
|
106
|
+
label: "$(symbol-method) Scripted effect",
|
|
107
|
+
detail: "common/scripted_effects/ (with a PdxDoc stub)",
|
|
108
|
+
nameLabel: "effect",
|
|
109
|
+
nameKind: "identifier",
|
|
110
|
+
scriptPath: "common/scripted_effects/$PREFIX$_scripted_effects.txt",
|
|
111
|
+
cursorMarker: "# effects here",
|
|
112
|
+
block: `# What this does.
|
|
113
|
+
# @scope country (root is the country affected)
|
|
114
|
+
# @param EXAMPLE_PARAM describe each $PARAM$ the caller must pass
|
|
115
|
+
$NAME$ = {
|
|
116
|
+
# effects here
|
|
117
|
+
}
|
|
118
|
+
`,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "scripted_trigger",
|
|
122
|
+
label: "$(symbol-boolean) Scripted trigger",
|
|
123
|
+
detail: "common/scripted_triggers/ (with a PdxDoc stub)",
|
|
124
|
+
nameLabel: "trigger",
|
|
125
|
+
nameKind: "identifier",
|
|
126
|
+
scriptPath: "common/scripted_triggers/$PREFIX$_scripted_triggers.txt",
|
|
127
|
+
cursorMarker: "# conditions here",
|
|
128
|
+
block: `# What this checks.
|
|
129
|
+
# @scope country (root is the country tested)
|
|
130
|
+
$NAME$ = {
|
|
131
|
+
# conditions here
|
|
132
|
+
}
|
|
133
|
+
`,
|
|
134
|
+
},
|
|
135
|
+
];
|