@lpc-lang/core 1.1.2-5.1

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.
Files changed (317) hide show
  1. package/README.md +255 -0
  2. package/bin/lpc +4 -0
  3. package/bin/lpcserver +4 -0
  4. package/cancellationToken/cancellationToken.d.ts +8 -0
  5. package/cancellationToken/cancellationToken.d.ts.map +1 -0
  6. package/cancellationToken/serverCancellationToken.d.ts +21 -0
  7. package/cancellationToken/serverCancellationToken.d.ts.map +1 -0
  8. package/cli/_namespaces/lpc.d.ts +2 -0
  9. package/cli/_namespaces/lpc.d.ts.map +1 -0
  10. package/cli/lpc.d.ts +2 -0
  11. package/cli/lpc.d.ts.map +1 -0
  12. package/compiler/LpcConfig.d.ts +17 -0
  13. package/compiler/LpcConfig.d.ts.map +1 -0
  14. package/compiler/_namespaces/lpc.d.ts +49 -0
  15. package/compiler/_namespaces/lpc.d.ts.map +1 -0
  16. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts +2 -0
  17. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts.map +1 -0
  18. package/compiler/_namespaces/lpc.performance.d.ts +2 -0
  19. package/compiler/_namespaces/lpc.performance.d.ts.map +1 -0
  20. package/compiler/binder.d.ts +2 -0
  21. package/compiler/binder.d.ts.map +1 -0
  22. package/compiler/builderPublic.d.ts +76 -0
  23. package/compiler/builderPublic.d.ts.map +1 -0
  24. package/compiler/checker.d.ts +2 -0
  25. package/compiler/checker.d.ts.map +1 -0
  26. package/compiler/commandLineParser.d.ts +47 -0
  27. package/compiler/commandLineParser.d.ts.map +1 -0
  28. package/compiler/core.d.ts +3 -0
  29. package/compiler/core.d.ts.map +1 -0
  30. package/compiler/corePublic.d.ts +19 -0
  31. package/compiler/corePublic.d.ts.map +1 -0
  32. package/compiler/debug.d.ts +71 -0
  33. package/compiler/debug.d.ts.map +1 -0
  34. package/compiler/diagnosticInformation.d.ts +518 -0
  35. package/compiler/diagnosticInformation.d.ts.map +1 -0
  36. package/compiler/emitter.d.ts +11 -0
  37. package/compiler/emitter.d.ts.map +1 -0
  38. package/compiler/executeCommandLine.d.ts +15 -0
  39. package/compiler/executeCommandLine.d.ts.map +1 -0
  40. package/compiler/expressionToTypeNode.d.ts +2 -0
  41. package/compiler/expressionToTypeNode.d.ts.map +1 -0
  42. package/compiler/factory/baseNodeFactory.d.ts +2 -0
  43. package/compiler/factory/baseNodeFactory.d.ts.map +1 -0
  44. package/compiler/factory/emitHelper.d.ts +2 -0
  45. package/compiler/factory/emitHelper.d.ts.map +1 -0
  46. package/compiler/factory/emitNode.d.ts +22 -0
  47. package/compiler/factory/emitNode.d.ts.map +1 -0
  48. package/compiler/factory/nodeChildren.d.ts +2 -0
  49. package/compiler/factory/nodeChildren.d.ts.map +1 -0
  50. package/compiler/factory/nodeConverters.d.ts +2 -0
  51. package/compiler/factory/nodeConverters.d.ts.map +1 -0
  52. package/compiler/factory/nodeFactory.d.ts +4 -0
  53. package/compiler/factory/nodeFactory.d.ts.map +1 -0
  54. package/compiler/factory/parenthesizerRules.d.ts +2 -0
  55. package/compiler/factory/parenthesizerRules.d.ts.map +1 -0
  56. package/compiler/factory/utilities.d.ts +2 -0
  57. package/compiler/factory/utilities.d.ts.map +1 -0
  58. package/compiler/factory/utilitiesPublic.d.ts +4 -0
  59. package/compiler/factory/utilitiesPublic.d.ts.map +1 -0
  60. package/compiler/lpcFileHandler.d.ts +10 -0
  61. package/compiler/lpcFileHandler.d.ts.map +1 -0
  62. package/compiler/lpcJsHelpers.d.ts +17 -0
  63. package/compiler/lpcJsHelpers.d.ts.map +1 -0
  64. package/compiler/lpcbuild.d.ts +2 -0
  65. package/compiler/lpcbuild.d.ts.map +1 -0
  66. package/compiler/lpcbuildPublic.d.ts +26 -0
  67. package/compiler/lpcbuildPublic.d.ts.map +1 -0
  68. package/compiler/moduleNameResolver.d.ts +55 -0
  69. package/compiler/moduleNameResolver.d.ts.map +1 -0
  70. package/compiler/moduleSpecifiers.d.ts +2 -0
  71. package/compiler/moduleSpecifiers.d.ts.map +1 -0
  72. package/compiler/nodeTests.d.ts +115 -0
  73. package/compiler/nodeTests.d.ts.map +1 -0
  74. package/compiler/parser.d.ts +65 -0
  75. package/compiler/parser.d.ts.map +1 -0
  76. package/compiler/path.d.ts +2 -0
  77. package/compiler/path.d.ts.map +1 -0
  78. package/compiler/perfLoger.d.ts +2 -0
  79. package/compiler/perfLoger.d.ts.map +1 -0
  80. package/compiler/performance.d.ts +2 -0
  81. package/compiler/performance.d.ts.map +1 -0
  82. package/compiler/performanceCore.d.ts +2 -0
  83. package/compiler/performanceCore.d.ts.map +1 -0
  84. package/compiler/program.d.ts +72 -0
  85. package/compiler/program.d.ts.map +1 -0
  86. package/compiler/resolutionCache.d.ts +6 -0
  87. package/compiler/resolutionCache.d.ts.map +1 -0
  88. package/compiler/resolver.d.ts +1 -0
  89. package/compiler/resolver.d.ts.map +1 -0
  90. package/compiler/scanner.d.ts +85 -0
  91. package/compiler/scanner.d.ts.map +1 -0
  92. package/compiler/sourcemap.d.ts +2 -0
  93. package/compiler/sourcemap.d.ts.map +1 -0
  94. package/compiler/sys.d.ts +56 -0
  95. package/compiler/sys.d.ts.map +1 -0
  96. package/compiler/tracing.d.ts +31 -0
  97. package/compiler/tracing.d.ts.map +1 -0
  98. package/compiler/transformers/declarations.d.ts +2 -0
  99. package/compiler/transformers/declarations.d.ts.map +1 -0
  100. package/compiler/transformers.d.ts +2 -0
  101. package/compiler/transformers.d.ts.map +1 -0
  102. package/compiler/types.d.ts +3284 -0
  103. package/compiler/types.d.ts.map +1 -0
  104. package/compiler/utilities.d.ts +57 -0
  105. package/compiler/utilities.d.ts.map +1 -0
  106. package/compiler/utilitiesPublic.d.ts +213 -0
  107. package/compiler/utilitiesPublic.d.ts.map +1 -0
  108. package/compiler/visitorPublic.d.ts +72 -0
  109. package/compiler/visitorPublic.d.ts.map +1 -0
  110. package/compiler/watch.d.ts +2 -0
  111. package/compiler/watch.d.ts.map +1 -0
  112. package/compiler/watchPublic.d.ts +44 -0
  113. package/compiler/watchPublic.d.ts.map +1 -0
  114. package/compiler/watchUtilities.d.ts +14 -0
  115. package/compiler/watchUtilities.d.ts.map +1 -0
  116. package/config-types.d.ts +33 -0
  117. package/config-types.d.ts.map +1 -0
  118. package/harness/harnessIO.d.ts +4 -0
  119. package/harness/harnessIO.d.ts.map +1 -0
  120. package/lpc/_namespaces/lpc.d.ts +6 -0
  121. package/lpc/_namespaces/lpc.d.ts.map +1 -0
  122. package/lpc/_namespaces/lpc.server.d.ts +2 -0
  123. package/lpc/_namespaces/lpc.server.d.ts.map +1 -0
  124. package/lpc/lpc.d.ts +2 -0
  125. package/lpc/lpc.d.ts.map +1 -0
  126. package/lpcserver/document.d.ts +1 -0
  127. package/lpcserver/document.d.ts.map +1 -0
  128. package/lpcserver/nodeServer.d.ts +25 -0
  129. package/lpcserver/nodeServer.d.ts.map +1 -0
  130. package/lpcserver/protocol.const.d.ts +46 -0
  131. package/lpcserver/protocol.const.d.ts.map +1 -0
  132. package/lpcserver/server.d.ts +3 -0
  133. package/lpcserver/server.d.ts.map +1 -0
  134. package/lpcserver/textRendering.d.ts +14 -0
  135. package/lpcserver/textRendering.d.ts.map +1 -0
  136. package/lpcserver/typeConverters.d.ts +44 -0
  137. package/lpcserver/typeConverters.d.ts.map +1 -0
  138. package/lpcserver/utils.d.ts +14 -0
  139. package/lpcserver/utils.d.ts.map +1 -0
  140. package/package.json +48 -0
  141. package/parse-fluff-docs.d.ts +2 -0
  142. package/parse-fluff-docs.d.ts.map +1 -0
  143. package/parse-ld-docs.d.ts +2 -0
  144. package/parse-ld-docs.d.ts.map +1 -0
  145. package/server/_namespaces/lpc.d.ts +5 -0
  146. package/server/_namespaces/lpc.d.ts.map +1 -0
  147. package/server/_namespaces/lpc.server.d.ts +11 -0
  148. package/server/_namespaces/lpc.server.d.ts.map +1 -0
  149. package/server/_namespaces/lpc.server.protocol.d.ts +2 -0
  150. package/server/_namespaces/lpc.server.protocol.d.ts.map +1 -0
  151. package/server/editorServices.d.ts +261 -0
  152. package/server/editorServices.d.ts.map +1 -0
  153. package/server/project.d.ts +143 -0
  154. package/server/project.d.ts.map +1 -0
  155. package/server/protocol.d.ts +962 -0
  156. package/server/protocol.d.ts.map +1 -0
  157. package/server/scriptInfo.d.ts +53 -0
  158. package/server/scriptInfo.d.ts.map +1 -0
  159. package/server/scriptVersionCache.d.ts +2 -0
  160. package/server/scriptVersionCache.d.ts.map +1 -0
  161. package/server/session.d.ts +150 -0
  162. package/server/session.d.ts.map +1 -0
  163. package/server/types.d.ts +24 -0
  164. package/server/types.d.ts.map +1 -0
  165. package/server/utilities.d.ts +2 -0
  166. package/server/utilities.d.ts.map +1 -0
  167. package/server/utilitiesPublic.d.ts +37 -0
  168. package/server/utilitiesPublic.d.ts.map +1 -0
  169. package/server.d.ts +2 -0
  170. package/server.d.ts.map +1 -0
  171. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts +2 -0
  172. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts.map +1 -0
  173. package/services/_namespaces/lpc.Completions.d.ts +4 -0
  174. package/services/_namespaces/lpc.Completions.d.ts.map +1 -0
  175. package/services/_namespaces/lpc.FindAllReferences.d.ts +3 -0
  176. package/services/_namespaces/lpc.FindAllReferences.d.ts.map +1 -0
  177. package/services/_namespaces/lpc.GoToDefinition.d.ts +2 -0
  178. package/services/_namespaces/lpc.GoToDefinition.d.ts.map +1 -0
  179. package/services/_namespaces/lpc.JsDoc.d.ts +2 -0
  180. package/services/_namespaces/lpc.JsDoc.d.ts.map +1 -0
  181. package/services/_namespaces/lpc.NavigationBar.d.ts +2 -0
  182. package/services/_namespaces/lpc.NavigationBar.d.ts.map +1 -0
  183. package/services/_namespaces/lpc.Rename.d.ts +2 -0
  184. package/services/_namespaces/lpc.Rename.d.ts.map +1 -0
  185. package/services/_namespaces/lpc.SignatureHelp.d.ts +2 -0
  186. package/services/_namespaces/lpc.SignatureHelp.d.ts.map +1 -0
  187. package/services/_namespaces/lpc.SymbolDisplay.d.ts +2 -0
  188. package/services/_namespaces/lpc.SymbolDisplay.d.ts.map +1 -0
  189. package/services/_namespaces/lpc.codefix.d.ts +3 -0
  190. package/services/_namespaces/lpc.codefix.d.ts.map +1 -0
  191. package/services/_namespaces/lpc.d.ts +30 -0
  192. package/services/_namespaces/lpc.d.ts.map +1 -0
  193. package/services/_namespaces/lpc.formatting.d.ts +7 -0
  194. package/services/_namespaces/lpc.formatting.d.ts.map +1 -0
  195. package/services/_namespaces/lpc.textChanges.d.ts +2 -0
  196. package/services/_namespaces/lpc.textChanges.d.ts.map +1 -0
  197. package/services/classifier2020.d.ts +2 -0
  198. package/services/classifier2020.d.ts.map +1 -0
  199. package/services/codefixes/helpers.d.ts +2 -0
  200. package/services/codefixes/helpers.d.ts.map +1 -0
  201. package/services/codefixes/importFixes.d.ts +2 -0
  202. package/services/codefixes/importFixes.d.ts.map +1 -0
  203. package/services/completions.d.ts +2 -0
  204. package/services/completions.d.ts.map +1 -0
  205. package/services/documentRegistry.d.ts +90 -0
  206. package/services/documentRegistry.d.ts.map +1 -0
  207. package/services/exportInfoMap.d.ts +5 -0
  208. package/services/exportInfoMap.d.ts.map +1 -0
  209. package/services/findAllReferences.d.ts +2 -0
  210. package/services/findAllReferences.d.ts.map +1 -0
  211. package/services/formatting/formatting.d.ts +2 -0
  212. package/services/formatting/formatting.d.ts.map +1 -0
  213. package/services/formatting/formattingContext.d.ts +2 -0
  214. package/services/formatting/formattingContext.d.ts.map +1 -0
  215. package/services/formatting/rule.d.ts +2 -0
  216. package/services/formatting/rule.d.ts.map +1 -0
  217. package/services/formatting/rules.d.ts +2 -0
  218. package/services/formatting/rules.d.ts.map +1 -0
  219. package/services/formatting/rulesMap.d.ts +2 -0
  220. package/services/formatting/rulesMap.d.ts.map +1 -0
  221. package/services/formatting/smartIndenter.d.ts +2 -0
  222. package/services/formatting/smartIndenter.d.ts.map +1 -0
  223. package/services/goToDefinition.d.ts +2 -0
  224. package/services/goToDefinition.d.ts.map +1 -0
  225. package/services/importTracker.d.ts +2 -0
  226. package/services/importTracker.d.ts.map +1 -0
  227. package/services/jsDoc.d.ts +2 -0
  228. package/services/jsDoc.d.ts.map +1 -0
  229. package/services/navigationBar.d.ts +2 -0
  230. package/services/navigationBar.d.ts.map +1 -0
  231. package/services/rename.d.ts +2 -0
  232. package/services/rename.d.ts.map +1 -0
  233. package/services/services.d.ts +54 -0
  234. package/services/services.d.ts.map +1 -0
  235. package/services/signatureHelp.d.ts +2 -0
  236. package/services/signatureHelp.d.ts.map +1 -0
  237. package/services/sourcemaps.d.ts +2 -0
  238. package/services/sourcemaps.d.ts.map +1 -0
  239. package/services/stringCompletions.d.ts +2 -0
  240. package/services/stringCompletions.d.ts.map +1 -0
  241. package/services/suggestionDiagnostics.d.ts +2 -0
  242. package/services/suggestionDiagnostics.d.ts.map +1 -0
  243. package/services/symbolDisplay.d.ts +2 -0
  244. package/services/symbolDisplay.d.ts.map +1 -0
  245. package/services/textChanges.d.ts +2 -0
  246. package/services/textChanges.d.ts.map +1 -0
  247. package/services/types.d.ts +901 -0
  248. package/services/types.d.ts.map +1 -0
  249. package/services/utilities.d.ts +3 -0
  250. package/services/utilities.d.ts.map +1 -0
  251. package/src/cli.js +58 -0
  252. package/src/cli.js.map +7 -0
  253. package/src/efuns/fluffos/arrays.h +205 -0
  254. package/src/efuns/fluffos/async.h +84 -0
  255. package/src/efuns/fluffos/buffers.h +80 -0
  256. package/src/efuns/fluffos/calls.h +275 -0
  257. package/src/efuns/fluffos/contrib.h +805 -0
  258. package/src/efuns/fluffos/db.h +125 -0
  259. package/src/efuns/fluffos/driver.h +107 -0
  260. package/src/efuns/fluffos/ed.h +48 -0
  261. package/src/efuns/fluffos/efuns.fluffos.h +75 -0
  262. package/src/efuns/fluffos/external.h +30 -0
  263. package/src/efuns/fluffos/filesystem.h +154 -0
  264. package/src/efuns/fluffos/floats.h +136 -0
  265. package/src/efuns/fluffos/functions.h +104 -0
  266. package/src/efuns/fluffos/general.h +548 -0
  267. package/src/efuns/fluffos/interactive.h +777 -0
  268. package/src/efuns/fluffos/internals.h +455 -0
  269. package/src/efuns/fluffos/lpc-config.json +10 -0
  270. package/src/efuns/fluffos/mappings.h +205 -0
  271. package/src/efuns/fluffos/misc.h +43 -0
  272. package/src/efuns/fluffos/mudlib.h +228 -0
  273. package/src/efuns/fluffos/numbers.h +41 -0
  274. package/src/efuns/fluffos/objects.h +365 -0
  275. package/src/efuns/fluffos/parsing.h +220 -0
  276. package/src/efuns/fluffos/pcre.h +75 -0
  277. package/src/efuns/fluffos/sockets.h +276 -0
  278. package/src/efuns/fluffos/strings.h +542 -0
  279. package/src/efuns/fluffos/system.h +408 -0
  280. package/src/efuns/fluffos/zh-cn/arrays.zh-cn.h +167 -0
  281. package/src/efuns/fluffos/zh-cn/async.zh-cn.h +81 -0
  282. package/src/efuns/fluffos/zh-cn/buffers.zh-cn.h +69 -0
  283. package/src/efuns/fluffos/zh-cn/calls.zh-cn.h +242 -0
  284. package/src/efuns/fluffos/zh-cn/contrib.zh-cn.h +767 -0
  285. package/src/efuns/fluffos/zh-cn/db.zh-cn.h +113 -0
  286. package/src/efuns/fluffos/zh-cn/ed.zh-cn.h +42 -0
  287. package/src/efuns/fluffos/zh-cn/efuns.fluffos.h +76 -0
  288. package/src/efuns/fluffos/zh-cn/external.zh-cn.h +25 -0
  289. package/src/efuns/fluffos/zh-cn/filesystem.zh-cn.h +140 -0
  290. package/src/efuns/fluffos/zh-cn/floats.zh-cn.h +129 -0
  291. package/src/efuns/fluffos/zh-cn/functions.zh-cn.h +87 -0
  292. package/src/efuns/fluffos/zh-cn/general.zh-cn.h +506 -0
  293. package/src/efuns/fluffos/zh-cn/interactive.zh-cn.h +659 -0
  294. package/src/efuns/fluffos/zh-cn/internals.zh-cn.h +356 -0
  295. package/src/efuns/fluffos/zh-cn/mappings.zh-cn.h +188 -0
  296. package/src/efuns/fluffos/zh-cn/misc.zh-cn.h +43 -0
  297. package/src/efuns/fluffos/zh-cn/mudlib.zh-cn.h +190 -0
  298. package/src/efuns/fluffos/zh-cn/numbers.zh-cn.h +36 -0
  299. package/src/efuns/fluffos/zh-cn/objects.zh-cn.h +280 -0
  300. package/src/efuns/fluffos/zh-cn/parsing.zh-cn.h +212 -0
  301. package/src/efuns/fluffos/zh-cn/pcre.zh-cn.h +67 -0
  302. package/src/efuns/fluffos/zh-cn/sockets.zh-cn.h +230 -0
  303. package/src/efuns/fluffos/zh-cn/strings.zh-cn.h +484 -0
  304. package/src/efuns/fluffos/zh-cn/system.zh-cn.h +366 -0
  305. package/src/efuns/ldmud/defines.h +69 -0
  306. package/src/efuns/ldmud/efun.h +10449 -0
  307. package/src/efuns/ldmud/efuns.ldmud.h +87 -0
  308. package/src/efuns/ldmud/lpc-config.json +9 -0
  309. package/src/efuns/ldmud/obsolete.h +2168 -0
  310. package/src/lpc.js +82486 -0
  311. package/src/lpc.js.map +6 -0
  312. package/src/server.js +129 -0
  313. package/src/server.js.map +7 -0
  314. package/types.d.ts +23 -0
  315. package/types.d.ts.map +1 -0
  316. package/utils.d.ts +21 -0
  317. package/utils.d.ts.map +1 -0
@@ -0,0 +1,261 @@
1
+ import { CompilerOptions, Diagnostic, JSDocParsingMode, LanguageServiceMode, Path, ScriptKind, TypeAcquisition, UserPreferences, WatchOptions } from "./_namespaces/lpc.js";
2
+ import { ConfiguredProject, HostCancellationToken, InferredProject, Logger, NormalizedPath, Project, ScriptInfo, ServerHost, Session } from "./_namespaces/lpc.server.js";
3
+ import * as protocol from "./protocol.js";
4
+ export declare const maxProgramSizeForNonTsFiles: number;
5
+ export declare const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
6
+ export declare const ProjectLoadingStartEvent = "projectLoadingStart";
7
+ export declare const ProjectLoadingFinishEvent = "projectLoadingFinish";
8
+ export declare const LargeFileReferencedEvent = "largeFileReferenced";
9
+ export declare const ConfigFileDiagEvent = "configFileDiag";
10
+ export declare const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
11
+ export declare const ProjectInfoTelemetryEvent = "projectInfo";
12
+ export declare const OpenFileInfoTelemetryEvent = "openFileInfo";
13
+ export declare const CreateFileWatcherEvent: protocol.CreateFileWatcherEventName;
14
+ export declare const CreateDirectoryWatcherEvent: protocol.CreateDirectoryWatcherEventName;
15
+ export declare const CloseFileWatcherEvent: protocol.CloseFileWatcherEventName;
16
+ export interface ProjectsUpdatedInBackgroundEvent {
17
+ eventName: typeof ProjectsUpdatedInBackgroundEvent;
18
+ data: {
19
+ openFiles: string[];
20
+ };
21
+ }
22
+ export declare class ProjectService {
23
+ /**
24
+ * All the open script info that needs recalculation of the default project,
25
+ * this also caches config file info before config file change was detected to use it in case projects are not updated yet
26
+ */
27
+ private pendingOpenFileProjectUpdates?;
28
+ readonly currentDirectory: NormalizedPath;
29
+ readonly toCanonicalFileName: (f: string) => string;
30
+ private pendingProjectUpdates;
31
+ readonly host: ServerHost;
32
+ readonly logger: Logger;
33
+ readonly cancellationToken: HostCancellationToken;
34
+ readonly useInferredProjectPerProjectRoot: boolean;
35
+ private readonly globalCacheLocationDirectoryPath;
36
+ readonly serverMode: LanguageServiceMode;
37
+ readonly throttleWaitMilliseconds?: number;
38
+ private readonly hostConfiguration;
39
+ private readonly suppressDiagnosticEvents?;
40
+ readonly useSingleInferredProject: boolean;
41
+ /**
42
+ * Project size for configured or external projects
43
+ */
44
+ private readonly projectToSizeMap;
45
+ private performanceEventHandler?;
46
+ /**
47
+ * projects specified by a lpc-config.json file
48
+ */
49
+ readonly configuredProjects: Map<string, ConfiguredProject>;
50
+ /**
51
+ * projects built from openFileRoots
52
+ */
53
+ readonly inferredProjects: InferredProject[];
54
+ /**
55
+ * Open files: with value being project root path, and key being Path of the file that is open
56
+ */
57
+ readonly openFiles: Map<Path, NormalizedPath | undefined>;
58
+ /** Config files looked up and cached config files for open script info */
59
+ private readonly configFileForOpenFiles;
60
+ /** Set of open script infos that are root of inferred project */
61
+ private rootOfInferredProjects;
62
+ /**
63
+ * Contains all the deleted script info's version information so that
64
+ * it does not reset when creating script info again
65
+ * (and could have potentially collided with version where contents mismatch)
66
+ */
67
+ private readonly filenameToScriptInfoVersion;
68
+ /**
69
+ * Map of open files that are opened without complete path but have projectRoot as current directory
70
+ */
71
+ private readonly openFilesWithNonRootedDiskPath;
72
+ private compilerOptionsForInferredProjects;
73
+ private compilerOptionsForInferredProjectsPerProjectRoot;
74
+ private watchOptionsForInferredProjects;
75
+ private watchOptionsForInferredProjectsPerProjectRoot;
76
+ private typeAcquisitionForInferredProjects;
77
+ private typeAcquisitionForInferredProjectsPerProjectRoot;
78
+ readonly jsDocParsingMode: JSDocParsingMode | undefined;
79
+ constructor(opts: ProjectServiceOptions);
80
+ private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath;
81
+ getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo;
82
+ getPreferences(file: NormalizedPath): UserPreferences;
83
+ private ensureProjectChildren;
84
+ private getOrCreateScriptInfoWorker;
85
+ private stopWatchingScriptInfo;
86
+ private watchClosedScriptInfo;
87
+ private delayUpdateProjectGraph;
88
+ getScriptInfoForPath(fileName: Path): ScriptInfo;
89
+ toPath(fileName: string): Path;
90
+ private delayUpdateProjectGraphs;
91
+ private deleteScriptInfo;
92
+ private handleDeletedFile;
93
+ private getModifiedTime;
94
+ private onSourceFileChanged;
95
+ private handleSourceMapProjects;
96
+ findAndOpenLpcConfig(projectRootPath: string): NormalizedPath | undefined;
97
+ private cleanupConfiguredProjects;
98
+ private removeProject;
99
+ private cleanupProjectsAndScriptInfos;
100
+ private printProjects;
101
+ openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
102
+ /**
103
+ * Finds the default configured project for given info
104
+ * For any tsconfig found, it looks into that project, if not then all its references,
105
+ * The search happens for all tsconfigs till projectRootPath
106
+ */
107
+ private tryFindDefaultConfiguredProjectForOpenScriptInfo;
108
+ private updateRootAndOptionsOfNonInferredProject;
109
+ private addFilesToNonInferredProject;
110
+ private updateNonInferredProjectFiles;
111
+ /**
112
+ * Remove the root of inferred project if script info is part of another project
113
+ */
114
+ private removeRootOfInferredProjectIfNowPartOfOtherProject;
115
+ /**
116
+ * Finds the default configured project, if found, it creates the solution projects (does not load them right away)
117
+ * with Find: finds the projects even if the project is deferredClosed
118
+ */
119
+ private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
120
+ private assignProjectToOpenedScriptInfo;
121
+ private getOrCreateInferredProjectForProjectRootPathIfEnabled;
122
+ private getOrCreateSingleInferredProjectIfEnabled;
123
+ private getOrCreateSingleInferredWithoutProjectRoot;
124
+ setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
125
+ private createInferredProject;
126
+ private getOrCreateOpenScriptInfo;
127
+ private getConfiguredProjectByCanonicalConfigFilePath;
128
+ findProject(projectName: string): Project | undefined;
129
+ /**
130
+ * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred
131
+ */
132
+ getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo;
133
+ private configFileExists;
134
+ getScriptInfo(uncheckedFileName: string): ScriptInfo;
135
+ /**
136
+ * If there is default project calculation pending for this file,
137
+ * then it completes that calculation so that correct default project is used for the project
138
+ */
139
+ private tryGetDefaultProjectForEnsuringConfiguredProjectForFile;
140
+ /**
141
+ * Ensures the project structures are upto date
142
+ * This means,
143
+ * - we go through all the projects and update them if they are dirty
144
+ * - if updates reflect some change in structure or there was pending request to ensure projects for open files
145
+ * ensure that each open script info has project
146
+ */
147
+ private ensureProjectStructuresUptoDate;
148
+ /**
149
+ * This function is to update the project structure for every inferred project.
150
+ * It is called on the premise that all the configured projects are
151
+ * up to date.
152
+ * This will go through open files and assign them to inferred project if open file is not part of any other project
153
+ * After that all the inferred project graphs are updated
154
+ */
155
+ private ensureProjectForOpenFiles;
156
+ private doEnsureDefaultProjectForFile;
157
+ /**
158
+ * This function tries to search for a tsconfig.json for the given file.
159
+ * This is different from the method the compiler uses because
160
+ * the compiler can assume it will always start searching in the
161
+ * current directory (the directory in which tsc was invoked).
162
+ * The server must start searching from the directory containing
163
+ * the newly opened file.
164
+ */
165
+ private forEachConfigFileLocation;
166
+ /** Caches the configFilename for script info or ancestor of open script info */
167
+ private setConfigFileNameForFileInCache;
168
+ /** Get cached configFileName for scriptInfo or ancestor of open script info */
169
+ private getConfigFileNameForFileFromCache;
170
+ getFormatCodeOptions(file: NormalizedPath): any;
171
+ private createConfigFileWatcherForParsedConfig;
172
+ getHostPreferences(): UserPreferences;
173
+ /**
174
+ * Close file whose contents is managed by the client
175
+ * @param filename is absolute pathname
176
+ */
177
+ closeClientFile(uncheckedFileName: string): void;
178
+ /**
179
+ * Remove this file from the set of open, non-configured files.
180
+ * @param info The file that has been closed or newly configured
181
+ */
182
+ private closeOpenFile;
183
+ private assignOrphanScriptInfosToInferredProject;
184
+ }
185
+ export type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void;
186
+ export interface LargeFileReferencedEvent {
187
+ eventName: typeof LargeFileReferencedEvent;
188
+ data: {
189
+ file: string;
190
+ fileSize: number;
191
+ maxFileSize: number;
192
+ };
193
+ }
194
+ export type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | CreateFileWatcherEvent | CreateDirectoryWatcherEvent | CloseFileWatcherEvent;
195
+ export interface ProjectServiceOptions {
196
+ host: ServerHost;
197
+ logger: Logger;
198
+ cancellationToken: HostCancellationToken;
199
+ useSingleInferredProject: boolean;
200
+ useInferredProjectPerProjectRoot: boolean;
201
+ eventHandler?: ProjectServiceEventHandler;
202
+ canUseWatchEvents?: boolean;
203
+ suppressDiagnosticEvents?: boolean;
204
+ throttleWaitMilliseconds?: number;
205
+ globalPlugins?: readonly string[];
206
+ pluginProbeLocations?: readonly string[];
207
+ allowLocalPluginLoads?: boolean;
208
+ typesMapLocation?: string;
209
+ serverMode?: LanguageServiceMode;
210
+ session: Session<unknown> | undefined;
211
+ projectRootFolder?: string;
212
+ jsDocParsingMode?: JSDocParsingMode;
213
+ }
214
+ export interface OpenConfiguredProjectResult {
215
+ configFileName?: NormalizedPath;
216
+ configFileErrors?: readonly Diagnostic[];
217
+ }
218
+ export interface OpenFileArguments {
219
+ fileName: string;
220
+ content?: string;
221
+ scriptKind?: ScriptKind;
222
+ hasMixedContent?: boolean;
223
+ projectRootPath?: string;
224
+ }
225
+ export interface ConfigFileDiagEvent {
226
+ eventName: typeof ConfigFileDiagEvent;
227
+ data: {
228
+ triggerFile: string;
229
+ configFileName: string;
230
+ diagnostics: readonly Diagnostic[];
231
+ };
232
+ }
233
+ export interface ProjectLanguageServiceStateEvent {
234
+ eventName: typeof ProjectLanguageServiceStateEvent;
235
+ data: {
236
+ project: Project;
237
+ languageServiceEnabled: boolean;
238
+ };
239
+ }
240
+ export interface CreateFileWatcherEvent {
241
+ readonly eventName: protocol.CreateFileWatcherEventName;
242
+ readonly data: protocol.CreateFileWatcherEventBody;
243
+ }
244
+ export interface CreateDirectoryWatcherEvent {
245
+ readonly eventName: protocol.CreateDirectoryWatcherEventName;
246
+ readonly data: protocol.CreateDirectoryWatcherEventBody;
247
+ }
248
+ export interface CloseFileWatcherEvent {
249
+ readonly eventName: protocol.CloseFileWatcherEventName;
250
+ readonly data: protocol.CloseFileWatcherEventBody;
251
+ }
252
+ export declare function makeInferredProjectName(counter: number): string;
253
+ export interface WatchOptionsAndErrors {
254
+ watchOptions: WatchOptions;
255
+ errors: Diagnostic[] | undefined;
256
+ }
257
+ export declare function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.LPC;
258
+ export declare function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin;
259
+ export declare function convertWatchOptions(protocolOptions: protocol.ExternalProjectCompilerOptions, currentDirectory?: string): WatchOptionsAndErrors | undefined;
260
+ export declare function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined;
261
+ //# sourceMappingURL=editorServices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorServices.d.ts","sourceRoot":"./src/","sources":["src/server/editorServices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyL,eAAe,EAAoK,UAAU,EAA4nB,gBAAgB,EAAE,mBAAmB,EAA+Q,IAAI,EAA0L,UAAU,EAAwH,eAAe,EAAuF,eAAe,EAAsE,YAAY,EAAuC,MAAM,sBAAsB,CAAC;AACx3D,OAAO,EAAoB,iBAAiB,EAAyB,qBAAqB,EAAE,eAAe,EAAwG,MAAM,EAA2C,cAAc,EAAwB,OAAO,EAAe,UAAU,EAAsB,UAAU,EAAE,OAAO,EAAyC,MAAM,6BAA6B,CAAC;AAChc,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,2BAA2B,QAAmB,CAAC;AAI5D,eAAO,MAAM,gCAAgC,gCAAgC,CAAC;AAC9E,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAChE,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAC9D,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AACpD,eAAO,MAAM,gCAAgC,gCAAgC,CAAC;AAC9E,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AACvD,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AACzD,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,0BAAgD,CAAC;AAC/F,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,+BAA0D,CAAC;AAC9G,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,yBAA8C,CAAC;AAK5F,MAAM,WAAW,gCAAgC;IAC7C,SAAS,EAAE,OAAO,gC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AAC;CACpC;AAED,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,QAAQ,CAAC,cAAc,uCAO5E;AA2BD,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,QAAQ,CAAC,8BAA8B,GAAG,eAAe,GAAG,QAAQ,CAAC,kBAAkB,CAQ9I;AAED,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,QAAQ,CAAC,8BAA8B,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAY1J;AAED,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,QAAQ,CAAC,8BAA8B,GAAG,eAAe,GAAG,SAAS,CAQ5H"}
@@ -0,0 +1,143 @@
1
+ import * as lpc from "./_namespaces/lpc.js";
2
+ import { CompilerOptions, Diagnostic, DirectoryStructureHost, DocumentRegistry, IScriptSnapshot, JSDocParsingMode, LanguageService, LanguageServiceHost, ModuleResolutionHost, ProjectReference, TypeAcquisition, WatchOptions } from "./_namespaces/lpc.js";
3
+ import { HostCancellationToken, NormalizedPath, ProjectService, ScriptInfo } from "./_namespaces/lpc.server.js";
4
+ export declare enum ProjectKind {
5
+ Inferred = 0,
6
+ Configured = 1,
7
+ External = 2,
8
+ AutoImportProvider = 3,
9
+ Auxiliary = 4
10
+ }
11
+ export declare abstract class Project implements LanguageServiceHost, ModuleResolutionHost, lpc.LpcFileHandlerHost {
12
+ readonly projectKind: ProjectKind;
13
+ readonly projectService: ProjectService;
14
+ private documentRegistry;
15
+ private compilerOptions;
16
+ compileOnSaveEnabled: boolean;
17
+ protected watchOptions: WatchOptions | undefined;
18
+ private rootFilesMap;
19
+ private program;
20
+ private externalFiles;
21
+ private missingFilesMap;
22
+ private hasAddedorRemovedFiles;
23
+ private hasAddedOrRemovedSymlinks;
24
+ protected languageService: LanguageService;
25
+ languageServiceEnabled: boolean;
26
+ readonly trace?: (s: string) => void;
27
+ readonly realpath?: (path: string) => string;
28
+ /**
29
+ * Set of files names that were updated since the last call to getChangesSinceVersion.
30
+ */
31
+ private updatedFileNames;
32
+ /**
33
+ * Set of files that was returned from the last call to getChangesSinceVersion.
34
+ */
35
+ private lastReportedFileNames;
36
+ /**
37
+ * Last version that was reported.
38
+ */
39
+ private lastReportedVersion;
40
+ protected projectErrors: Diagnostic[] | undefined;
41
+ protected isInitialLoadPending: () => boolean;
42
+ private readonly cancellationToken;
43
+ private exportMapCache;
44
+ private changedFilesForExportMapCache;
45
+ fileHandler: lpc.LpcFileHandler;
46
+ readonly jsDocParsingMode: JSDocParsingMode | undefined;
47
+ constructor(projectName: string, projectKind: ProjectKind, projectService: ProjectService, documentRegistry: DocumentRegistry, hasExplicitListOfFiles: boolean, lastFileExceededProgramSize: string | undefined, compilerOptions: CompilerOptions, compileOnSaveEnabled: boolean, watchOptions: WatchOptions | undefined, directoryStructureHost: DirectoryStructureHost, currentDirectory: string);
48
+ disableLanguageService(lastFileExceededProgramSize?: string): void;
49
+ getIncludeDirs(): string[];
50
+ /**
51
+ * Get all the project errors
52
+ */
53
+ getAllProjectErrors(): readonly Diagnostic[];
54
+ getConfigFilePath(): lpc.server.NormalizedPath;
55
+ getCompilationSettings(): lpc.CompilerOptions;
56
+ getCompilerOptions(): lpc.CompilerOptions;
57
+ getNewLine(): string;
58
+ getProjectVersion(): string;
59
+ getScriptInfo(uncheckedFileName: string): lpc.server.ScriptInfo;
60
+ getRootScriptInfos(): lpc.server.ScriptInfo[];
61
+ getProjectReferences(): readonly ProjectReference[] | undefined;
62
+ getProjectName(): string;
63
+ onAllFilesNeedReparse(fileNames: string[]): void;
64
+ getScriptFileNames(): string[];
65
+ isClosed(): boolean;
66
+ hasRoots(): boolean;
67
+ setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
68
+ enableLanguageService(): void;
69
+ addRoot(info: ScriptInfo, fileName?: NormalizedPath): void;
70
+ getLanguageService(ensureSynchronized?: boolean): LanguageService;
71
+ setCompilerOptions(compilerOptions: CompilerOptions): void;
72
+ hasConfigFile(configFilePath: NormalizedPath): boolean;
73
+ getRootFiles(): NormalizedPath[];
74
+ getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): lpc.server.NormalizedPath[];
75
+ private getOrCreateScriptInfoAndAttachToProject;
76
+ getScriptKind(fileName: string): lpc.ScriptKind;
77
+ getScriptVersion(filename: string): string;
78
+ getScriptSnapshot(filename: string): IScriptSnapshot | undefined;
79
+ getCancellationToken(): HostCancellationToken;
80
+ getCurrentDirectory(): string;
81
+ getDefaultLibFileName(): string;
82
+ useCaseSensitiveFileNames(): boolean;
83
+ readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
84
+ readFile(fileName: string): string | undefined;
85
+ writeFile(fileName: string, content: string): void;
86
+ fileExists(file: string): boolean;
87
+ /**
88
+ * Get the errors that dont have any file name associated
89
+ */
90
+ getGlobalProjectErrors(): readonly Diagnostic[];
91
+ setProjectErrors(projectErrors: Diagnostic[] | undefined): void;
92
+ private isWatchedMissingFile;
93
+ isRoot(info: ScriptInfo): boolean;
94
+ protected removeRoot(info: ScriptInfo): void;
95
+ removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void;
96
+ addMissingFileRoot(fileName: NormalizedPath): void;
97
+ getTypeAcquisition(): lpc.TypeAcquisition;
98
+ /**
99
+ * Updates set of files that contribute to this project
100
+ * @returns: true if set of files in the project stays the same and false - otherwise.
101
+ */
102
+ updateGraph(): boolean;
103
+ close(): void;
104
+ private updateGraphWorker;
105
+ private addMissingFileWatcher;
106
+ registerFileUpdate(fileName: string): void;
107
+ containsScriptInfo(info: ScriptInfo): boolean;
108
+ filesToString(writeProjectFileNames: boolean): string;
109
+ private detachScriptInfoIfNotRoot;
110
+ private detachScriptInfoFromProject;
111
+ containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean;
112
+ getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
113
+ }
114
+ export declare class ConfiguredProject extends Project {
115
+ readonly canonicalConfigFilePath: NormalizedPath;
116
+ private projectReferences;
117
+ getProjectReferences(): readonly ProjectReference[] | undefined;
118
+ /**
119
+ * Get all the project errors
120
+ */
121
+ getAllProjectErrors(): readonly Diagnostic[];
122
+ /**
123
+ * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
124
+ * @returns: true if set of files in the project stays the same and false - otherwise.
125
+ */
126
+ updateGraph(): boolean;
127
+ updateReferences(refs: readonly ProjectReference[] | undefined): void;
128
+ close(): void;
129
+ /**
130
+ * Get the errors that dont have any file name associated
131
+ */
132
+ getGlobalProjectErrors(): readonly Diagnostic[];
133
+ setProjectErrors(projectErrors: Diagnostic[]): void;
134
+ }
135
+ export declare class InferredProject extends Project {
136
+ /** this is canonical project root path */
137
+ readonly projectRootPath: string | undefined;
138
+ isProjectWithSingleRoot(): boolean;
139
+ addRoot(info: ScriptInfo): void;
140
+ removeRoot(info: ScriptInfo): void;
141
+ close(): void;
142
+ }
143
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"./src/","sources":["src/server/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAqH,eAAe,EAA2G,UAAU,EAAE,sBAAsB,EAA4B,gBAAgB,EAAkT,eAAe,EAA0C,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAyD,oBAAoB,EAA6I,gBAAgB,EAAuU,eAAe,EAAgF,YAAY,EAAa,MAAM,sBAAsB,CAAC;AAC36C,OAAO,EAAwC,qBAAqB,EAAY,cAAc,EAAE,cAAc,EAAE,UAAU,EAAwB,MAAM,6BAA6B,CAAC;AActL,oBAAY,WAAW;IACnB,QAAQ,IAAA;IACR,UAAU,IAAA;IACV,QAAQ,IAAA;IACR,kBAAkB,IAAA;IAClB,SAAS,IAAA;CACZ;AAED,8BAAsB,OAAQ,YAAW,mBAAmB,EAAE,oBAAoB,EAAE,GAAG,CA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