@theia/filesystem 1.26.0-next.3 → 1.26.0-next.32
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/lib/browser/breadcrumbs/filepath-breadcrumbs-container.d.ts +1 -2
- package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.d.ts.map +1 -1
- package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.js +3 -4
- package/lib/browser/breadcrumbs/filepath-breadcrumbs-container.js.map +1 -1
- package/lib/browser/file-service.d.ts +5 -0
- package/lib/browser/file-service.d.ts.map +1 -1
- package/lib/browser/file-service.js +5 -0
- package/lib/browser/file-service.js.map +1 -1
- package/lib/browser/file-tree/file-tree-decorator-adapter.d.ts +1 -1
- package/lib/browser/file-tree/file-tree-decorator-adapter.js +1 -1
- package/lib/common/files.d.ts +12 -3
- package/lib/common/files.d.ts.map +1 -1
- package/lib/common/files.js.map +1 -1
- package/lib/common/filesystem-utils.spec.js +49 -49
- package/lib/common/filesystem-utils.spec.js.map +1 -1
- package/lib/common/filesystem.d.ts +0 -3
- package/lib/common/filesystem.d.ts.map +1 -1
- package/lib/common/filesystem.js +0 -3
- package/lib/common/filesystem.js.map +1 -1
- package/package.json +3 -3
- package/src/browser/breadcrumbs/filepath-breadcrumbs-container.ts +1 -2
- package/src/browser/file-service.ts +5 -0
- package/src/browser/file-tree/file-tree-decorator-adapter.ts +1 -1
- package/src/common/files.ts +12 -3
- package/src/common/filesystem-utils.spec.ts +1 -1
- package/src/common/filesystem.ts +0 -3
|
@@ -602,6 +602,11 @@ export class FileService {
|
|
|
602
602
|
|
|
603
603
|
/**
|
|
604
604
|
* Tests a user's permissions for the given resource.
|
|
605
|
+
* @param resource `URI` of the resource which should be tested.
|
|
606
|
+
* @param mode An optional integer that specifies the accessibility checks to be performed.
|
|
607
|
+
* Check `FileAccess.Constants` for possible values of mode.
|
|
608
|
+
* It is possible to create a mask consisting of the bitwise `OR` of two or more values (e.g. FileAccess.Constants.W_OK | FileAccess.Constants.R_OK).
|
|
609
|
+
* If `mode` is not defined, `FileAccess.Constants.F_OK` will be used instead.
|
|
605
610
|
*/
|
|
606
611
|
async access(resource: URI, mode?: number): Promise<boolean> {
|
|
607
612
|
const provider = await this.withProvider(resource);
|
|
@@ -143,7 +143,7 @@ export class FileTreeDecoratorAdapter implements TreeDecorator {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
|
-
* Sort higher priorities
|
|
146
|
+
* Sort higher priorities earlier. I.e. positive number means right higher than left.
|
|
147
147
|
*/
|
|
148
148
|
protected compareWeight(left: Decoration, right: Decoration): number {
|
|
149
149
|
return (right.weight ?? 0) - (left.weight ?? 0);
|
package/src/common/files.ts
CHANGED
|
@@ -698,16 +698,25 @@ export interface FileSystemProvider {
|
|
|
698
698
|
*/
|
|
699
699
|
export interface FileSystemProviderWithAccessCapability extends FileSystemProvider {
|
|
700
700
|
/**
|
|
701
|
-
*
|
|
701
|
+
* Tests a user's permissions for the file or directory specified by URI.
|
|
702
702
|
* @param resource The `URI` of the file that should be tested.
|
|
703
|
-
* @param mode
|
|
703
|
+
* @param mode An optional integer that specifies the accessibility checks to be performed.
|
|
704
|
+
* Check `FileAccess.Constants` for possible values of mode.
|
|
705
|
+
* It is possible to create a mask consisting of the bitwise `OR` of two or more values (e.g. FileAccess.Constants.W_OK | FileAccess.Constants.R_OK).
|
|
706
|
+
* If `mode` is not defined, `FileAccess.Constants.F_OK` will be used instead.
|
|
704
707
|
*
|
|
705
708
|
* @returns A promise that resolves if the user has the required permissions, should be rejected otherwise.
|
|
706
709
|
*/
|
|
707
710
|
access(resource: URI, mode?: number): Promise<void>;
|
|
708
711
|
|
|
709
712
|
/**
|
|
710
|
-
*
|
|
713
|
+
* Returns the path of the given file URI, specific to the backend's operating system.
|
|
714
|
+
* If the URI is not a file URI, undefined is returned.
|
|
715
|
+
*
|
|
716
|
+
* USE WITH CAUTION: You should always prefer URIs to paths if possible, as they are
|
|
717
|
+
* portable and platform independent. Paths should only be used in cases you directly
|
|
718
|
+
* interact with the OS, e.g. when running a command on the shell.
|
|
719
|
+
*
|
|
711
720
|
* @param resource `URI` of the resource to derive the path from.
|
|
712
721
|
*
|
|
713
722
|
* @returns A promise of the corresponding file system path.
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { FileSystemUtils } from '.';
|
|
18
17
|
import { FileStat } from './files';
|
|
19
18
|
import { expect } from 'chai';
|
|
19
|
+
import { FileSystemUtils } from './filesystem-utils';
|
|
20
20
|
|
|
21
21
|
describe('generateUniqueResourceURI', () => {
|
|
22
22
|
describe('Target is file', () => {
|
package/src/common/filesystem.ts
CHANGED
|
@@ -187,9 +187,6 @@ export interface FileSystem {
|
|
|
187
187
|
getFsPath(uri: string): Promise<string | undefined>
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
/**
|
|
191
|
-
* @deprecated since 1.4.0 - in order to support VS Code FS API (https://github.com/eclipse-theia/theia/pull/7908), use `FileService.access` instead
|
|
192
|
-
*/
|
|
193
190
|
export namespace FileAccess {
|
|
194
191
|
|
|
195
192
|
export namespace Constants {
|