@codingame/monaco-vscode-files-service-override 5.1.1 → 5.1.2

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 (2) hide show
  1. package/files.js +8 -2
  2. package/package.json +2 -2
package/files.js CHANGED
@@ -96,6 +96,12 @@ class RegisteredMemoryFile extends RegisteredFile {
96
96
  this._onDidChange.fire();
97
97
  }
98
98
  }
99
+ function addTrailingSlash(uri) {
100
+ if (!uri.endsWith('/')) {
101
+ return uri + '/';
102
+ }
103
+ return uri;
104
+ }
99
105
  const encoder = new TextEncoder();
100
106
  const decoder = new TextDecoder();
101
107
  class RegisteredFileSystemProvider extends Disposable {
@@ -161,7 +167,7 @@ class RegisteredFileSystemProvider extends Disposable {
161
167
  }
162
168
  const handledUris = Array.from(( this.files.keys()));
163
169
  for (const handledUri of handledUris) {
164
- if (handledUri.startsWith(resourceUri + '/')) {
170
+ if (handledUri.startsWith(addTrailingSlash(resourceUri))) {
165
171
  return {
166
172
  ctime: Date.now(),
167
173
  mtime: Date.now(),
@@ -175,7 +181,7 @@ class RegisteredFileSystemProvider extends Disposable {
175
181
  async readdir(resource) {
176
182
  const includedPaths = ( ( Array.from(( this.files.keys()))
177
183
  .map(uri => ( URI.parse(uri))))
178
- .filter(uri => uri.authority === resource.authority && uri.path.startsWith(resource.path + '/'))
184
+ .filter(uri => uri.authority === resource.authority && uri.path.startsWith(addTrailingSlash(resource.path)))
179
185
  .map(uri => extUri.relativePath(resource, uri)));
180
186
  const files = includedPaths.filter(path => !path.includes('/'));
181
187
  const directories = ( includedPaths.filter(path => path.includes('/')).map(path => path.slice(0, path.indexOf('/'))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-files-service-override",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@5.1.1"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@5.1.2"
30
30
  }
31
31
  }