@codingame/monaco-vscode-api 1.76.2 → 1.76.3-next.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.
Files changed (59) hide show
  1. package/README.md +2 -1
  2. package/dist/api.js +3 -860
  3. package/dist/{extHost.js → api2.js} +16555 -13467
  4. package/dist/async.js +107 -2
  5. package/dist/audioCue.js +105 -103
  6. package/dist/button.js +1 -1
  7. package/dist/cancellation.js +3 -0
  8. package/dist/configuration.js +7 -344
  9. package/dist/configuration2.js +339 -0
  10. package/dist/configurationRegistry.js +441 -0
  11. package/dist/contextkeys.js +211 -0
  12. package/dist/debug.d.ts +22 -0
  13. package/dist/debug.js +15842 -0
  14. package/dist/dialogs.js +855 -9
  15. package/dist/extensionResourceLoader.js +96 -0
  16. package/dist/extensions.d.ts +491 -0
  17. package/dist/extensions.js +70 -0
  18. package/dist/{tools.js → extensionsRegistry.js} +2 -30
  19. package/dist/files.js +1407 -334
  20. package/dist/iconv.js +43 -0
  21. package/dist/injection.js +1 -1
  22. package/dist/jschardet.js +7 -0
  23. package/dist/keybindings.d.ts +1 -485
  24. package/dist/keybindings.js +666 -679
  25. package/dist/labels.js +14 -0
  26. package/dist/languageConfiguration.d.ts +1 -2
  27. package/dist/languageConfiguration.js +9 -16
  28. package/dist/languageService.js +112 -8
  29. package/dist/languages.d.ts +1 -473
  30. package/dist/languages.js +2 -12
  31. package/dist/layout.js +4 -3
  32. package/dist/layoutService.js +1 -1
  33. package/dist/missing-services.js +4710 -74
  34. package/dist/modelEditor.d.ts +324 -2
  35. package/dist/modelEditor.js +15 -228
  36. package/dist/monaco.js +7 -72
  37. package/dist/notifications.js +75 -232
  38. package/dist/polyfill.js +10715 -2459
  39. package/dist/resources.js +197 -0
  40. package/dist/services.d.ts +924 -3
  41. package/dist/services.js +1 -2
  42. package/dist/services2.js +2436 -18
  43. package/dist/snippets.d.ts +1 -473
  44. package/dist/snippets.js +8 -867
  45. package/dist/snippetsService.js +868 -0
  46. package/dist/textFileEditorModel.js +2985 -0
  47. package/dist/textmate.d.ts +3 -475
  48. package/dist/textmate.js +19 -29
  49. package/dist/theme.d.ts +1 -3
  50. package/dist/theme.js +24 -70
  51. package/dist/tokenClassification.d.ts +1 -475
  52. package/dist/tokenClassification.js +11 -37
  53. package/dist/tokenClassificationRegistry.js +8 -4
  54. package/dist/variableResolver.js +1711 -0
  55. package/dist/workbenchThemeService.js +1 -1
  56. package/dist/workspaceContext.js +1 -3
  57. package/package.json +27 -12
  58. package/dist/contextkey.js +0 -419
  59. package/dist/dialog.web.contribution.js +0 -945
@@ -0,0 +1,197 @@
1
+ import { posix, dirname, normalize, relative, resolve, sep } from 'monaco-editor/esm/vs/base/common/path.js';
2
+ import { compare, equalsIgnoreCase } from 'monaco-editor/esm/vs/base/common/strings.js';
3
+ import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
4
+ import { isEqualOrParent, toSlashes, toPosixPath, getRoot } from 'monaco-editor/esm/vs/base/common/extpath.js';
5
+ import { URI, uriToFsPath } from 'monaco-editor/esm/vs/base/common/uri.js';
6
+ import { isWindows } from 'monaco-editor/esm/vs/base/common/platform.js';
7
+ function originalFSPath(uri) {
8
+ return uriToFsPath(uri, true);
9
+ }
10
+ class ExtUri {
11
+ constructor(_ignorePathCasing) {
12
+ this._ignorePathCasing = _ignorePathCasing;
13
+ }
14
+ compare(uri1, uri2, ignoreFragment = false) {
15
+ if (uri1 === uri2) {
16
+ return 0;
17
+ }
18
+ return compare(this.getComparisonKey(uri1, ignoreFragment), this.getComparisonKey(uri2, ignoreFragment));
19
+ }
20
+ isEqual(uri1, uri2, ignoreFragment = false) {
21
+ if (uri1 === uri2) {
22
+ return true;
23
+ }
24
+ if (!uri1 || !uri2) {
25
+ return false;
26
+ }
27
+ return this.getComparisonKey(uri1, ignoreFragment) === this.getComparisonKey(uri2, ignoreFragment);
28
+ }
29
+ getComparisonKey(uri, ignoreFragment = false) {
30
+ return ( uri.with({
31
+ path: this._ignorePathCasing(uri) ? uri.path.toLowerCase() : undefined,
32
+ fragment: ignoreFragment ? null : undefined
33
+ }).toString());
34
+ }
35
+ ignorePathCasing(uri) {
36
+ return this._ignorePathCasing(uri);
37
+ }
38
+ isEqualOrParent(base, parentCandidate, ignoreFragment = false) {
39
+ if (base.scheme === parentCandidate.scheme) {
40
+ if (base.scheme === Schemas.file) {
41
+ return isEqualOrParent(originalFSPath(base), originalFSPath(parentCandidate), this._ignorePathCasing(base)) && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment);
42
+ }
43
+ if (isEqualAuthority(base.authority, parentCandidate.authority)) {
44
+ return isEqualOrParent(base.path, parentCandidate.path, this._ignorePathCasing(base), '/') && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment);
45
+ }
46
+ }
47
+ return false;
48
+ }
49
+ joinPath(resource, ...pathFragment) {
50
+ return URI.joinPath(resource, ...pathFragment);
51
+ }
52
+ basenameOrAuthority(resource) {
53
+ return basename(resource) || resource.authority;
54
+ }
55
+ basename(resource) {
56
+ return posix.basename(resource.path);
57
+ }
58
+ extname(resource) {
59
+ return posix.extname(resource.path);
60
+ }
61
+ dirname(resource) {
62
+ if (resource.path.length === 0) {
63
+ return resource;
64
+ }
65
+ let dirname$1;
66
+ if (resource.scheme === Schemas.file) {
67
+ dirname$1 = URI.file(dirname(originalFSPath(resource))).path;
68
+ }
69
+ else {
70
+ dirname$1 = posix.dirname(resource.path);
71
+ if (resource.authority && dirname$1.length && dirname$1.charCodeAt(0) !== 47 ) {
72
+ console.error(`dirname("${resource.toString})) resulted in a relative path`);
73
+ dirname$1 = '/';
74
+ }
75
+ }
76
+ return resource.with({
77
+ path: dirname$1
78
+ });
79
+ }
80
+ normalizePath(resource) {
81
+ if (!resource.path.length) {
82
+ return resource;
83
+ }
84
+ let normalizedPath;
85
+ if (resource.scheme === Schemas.file) {
86
+ normalizedPath = URI.file(normalize(originalFSPath(resource))).path;
87
+ }
88
+ else {
89
+ normalizedPath = posix.normalize(resource.path);
90
+ }
91
+ return resource.with({
92
+ path: normalizedPath
93
+ });
94
+ }
95
+ relativePath(from, to) {
96
+ if (from.scheme !== to.scheme || !isEqualAuthority(from.authority, to.authority)) {
97
+ return undefined;
98
+ }
99
+ if (from.scheme === Schemas.file) {
100
+ const relativePath = relative(originalFSPath(from), originalFSPath(to));
101
+ return isWindows ? toSlashes(relativePath) : relativePath;
102
+ }
103
+ let fromPath = from.path || '/';
104
+ const toPath = to.path || '/';
105
+ if (this._ignorePathCasing(from)) {
106
+ let i = 0;
107
+ for (const len = Math.min(fromPath.length, toPath.length); i < len; i++) {
108
+ if (fromPath.charCodeAt(i) !== toPath.charCodeAt(i)) {
109
+ if (fromPath.charAt(i).toLowerCase() !== toPath.charAt(i).toLowerCase()) {
110
+ break;
111
+ }
112
+ }
113
+ }
114
+ fromPath = toPath.substr(0, i) + fromPath.substr(i);
115
+ }
116
+ return posix.relative(fromPath, toPath);
117
+ }
118
+ resolvePath(base, path) {
119
+ if (base.scheme === Schemas.file) {
120
+ const newURI = URI.file(resolve(originalFSPath(base), path));
121
+ return base.with({
122
+ authority: newURI.authority,
123
+ path: newURI.path
124
+ });
125
+ }
126
+ path = toPosixPath(path);
127
+ return base.with({
128
+ path: posix.resolve(base.path, path)
129
+ });
130
+ }
131
+ isAbsolutePath(resource) {
132
+ return !!resource.path && resource.path[0] === '/';
133
+ }
134
+ isEqualAuthority(a1, a2) {
135
+ return a1 === a2 || (a1 !== undefined && a2 !== undefined && equalsIgnoreCase(a1, a2));
136
+ }
137
+ hasTrailingPathSeparator(resource, sep$1 = sep) {
138
+ if (resource.scheme === Schemas.file) {
139
+ const fsp = originalFSPath(resource);
140
+ return fsp.length > getRoot(fsp).length && fsp[fsp.length - 1] === sep$1;
141
+ }
142
+ else {
143
+ const p = resource.path;
144
+ return ((p.length > 1 && p.charCodeAt(p.length - 1) === 47) ) && !(/^[a-zA-Z]:(\/$|\\$)/.test(resource.fsPath));
145
+ }
146
+ }
147
+ removeTrailingPathSeparator(resource, sep$1 = sep) {
148
+ if (hasTrailingPathSeparator(resource, sep$1)) {
149
+ return resource.with({ path: resource.path.substr(0, resource.path.length - 1) });
150
+ }
151
+ return resource;
152
+ }
153
+ addTrailingPathSeparator(resource, sep$1 = sep) {
154
+ let isRootSep = false;
155
+ if (resource.scheme === Schemas.file) {
156
+ const fsp = originalFSPath(resource);
157
+ isRootSep = ((fsp !== undefined) && (fsp.length === getRoot(fsp).length) && (fsp[fsp.length - 1] === sep$1));
158
+ }
159
+ else {
160
+ sep$1 = '/';
161
+ const p = resource.path;
162
+ isRootSep = p.length === 1 && p.charCodeAt(p.length - 1) === 47 ;
163
+ }
164
+ if (!isRootSep && !hasTrailingPathSeparator(resource, sep$1)) {
165
+ return resource.with({ path: resource.path + '/' });
166
+ }
167
+ return resource;
168
+ }
169
+ }
170
+ const extUri = ( new ExtUri(() => false));
171
+ extUri.isEqual.bind(extUri);
172
+ extUri.isEqualOrParent.bind(extUri);
173
+ extUri.getComparisonKey.bind(extUri);
174
+ extUri.basenameOrAuthority.bind(extUri);
175
+ const basename = extUri.basename.bind(extUri);
176
+ extUri.extname.bind(extUri);
177
+ extUri.dirname.bind(extUri);
178
+ extUri.joinPath.bind(extUri);
179
+ extUri.normalizePath.bind(extUri);
180
+ extUri.relativePath.bind(extUri);
181
+ extUri.resolvePath.bind(extUri);
182
+ extUri.isAbsolutePath.bind(extUri);
183
+ const isEqualAuthority = extUri.isEqualAuthority.bind(extUri);
184
+ const hasTrailingPathSeparator = extUri.hasTrailingPathSeparator.bind(extUri);
185
+ extUri.removeTrailingPathSeparator.bind(extUri);
186
+ extUri.addTrailingPathSeparator.bind(extUri);
187
+ function toLocalResource(resource, authority, localScheme) {
188
+ if (authority) {
189
+ let path = resource.path;
190
+ if (path && path[0] !== posix.sep) {
191
+ path = posix.sep + path;
192
+ }
193
+ return resource.with({ scheme: localScheme, authority, path });
194
+ }
195
+ return resource.with({ scheme: localScheme });
196
+ }
197
+ export { toLocalResource as t };