editors - improve file not found placeholder (#133829)

上级 111feb1e
......@@ -270,7 +270,7 @@ export namespace SymlinkSupport {
return { stat: stats, symbolicLink: lstats?.isSymbolicLink() ? { dangling: false } : undefined };
} catch (error) {
// If the link points to a non-existing file we still want
// If the link points to a nonexistent file we still want
// to return it as result while setting dangling: true flag
if (error.code === 'ENOENT' && lstats) {
return { stat: lstats, symbolicLink: { dangling: true } };
......@@ -285,7 +285,7 @@ export namespace SymlinkSupport {
return { stat: stats, symbolicLink: { dangling: false } };
} catch (error) {
// If the link points to a non-existing file we still want
// If the link points to a nonexistent file we still want
// to return it as result while setting dangling: true flag
if (error.code === 'ENOENT' && lstats) {
return { stat: lstats, symbolicLink: { dangling: true } };
......@@ -304,7 +304,7 @@ export namespace SymlinkSupport {
* for symlinks.
*
* Note: this will return `false` for a symlink that exists on
* disk but is dangling (pointing to a non-existing path).
* disk but is dangling (pointing to a nonexistent path).
*
* Use `exists` if you only care about the path existing on disk
* or not without support for symbolic links.
......@@ -326,7 +326,7 @@ export namespace SymlinkSupport {
* symlinks.
*
* Note: this will return `false` for a symlink that exists on
* disk but is dangling (pointing to a non-existing path).
* disk but is dangling (pointing to a nonexistent path).
*
* Use `exists` if you only care about the path existing on disk
* or not without support for symbolic links.
......
......@@ -172,7 +172,7 @@ export class FileService extends Disposable implements IFileService {
// Specially handle file not found case as file operation result
if (toFileSystemProviderErrorCode(error) === FileSystemProviderErrorCode.FileNotFound) {
throw new FileOperationError(localize('fileNotFoundError', "Unable to resolve non-existing file '{0}'", this.resourceForError(resource)), FileOperationResult.FILE_NOT_FOUND);
throw new FileOperationError(localize('fileNotFoundError', "Unable to resolve nonexistent file '{0}'", this.resourceForError(resource)), FileOperationResult.FILE_NOT_FOUND);
}
// Bubble up any other error as is
......@@ -935,7 +935,7 @@ export class FileService extends Disposable implements IFileService {
if (stat) {
this.throwIfFileIsReadonly(resource, stat);
} else {
throw new FileOperationError(localize('deleteFailedNotFound', "Unable to delete non-existing file '{0}'", this.resourceForError(resource)), FileOperationResult.FILE_NOT_FOUND);
throw new FileOperationError(localize('deleteFailedNotFound', "Unable to delete nonexistent file '{0}'", this.resourceForError(resource)), FileOperationResult.FILE_NOT_FOUND);
}
// Validate recursive
......
......@@ -124,7 +124,7 @@ export class DiskFileSystemProvider extends Disposable implements
private toType(entry: Stats | IDirent, symbolicLink?: { dangling: boolean }): FileType {
// Signal file type by checking for file / directory, except:
// - symbolic links pointing to non-existing files are FileType.Unknown
// - symbolic links pointing to nonexistent files are FileType.Unknown
// - files that are neither file nor directory are FileType.Unknown
let type: FileType;
if (symbolicLink?.dangling) {
......
......@@ -442,7 +442,7 @@ flakySuite('Disk File Service', function () {
assert.strictEqual(resolved.isSymbolicLink, true);
});
test('resolve - symbolic link pointing to non-existing file does not break', async () => {
test('resolve - symbolic link pointing to nonexistent file does not break', async () => {
await Promises.symlink(join(testDir, 'foo'), join(testDir, 'bar'), 'junction');
const resolved = await service.resolve(URI.file(testDir));
......@@ -513,7 +513,7 @@ flakySuite('Disk File Service', function () {
assert.strictEqual(existsSync(target.fsPath), true); // target the link pointed to is never deleted
});
(isWindows ? test.skip /* windows: cannot create file symbolic link without elevated context */ : test)('deleteFile - symbolic link (pointing to non-existing file)', async () => {
(isWindows ? test.skip /* windows: cannot create file symbolic link without elevated context */ : test)('deleteFile - symbolic link (pointing to nonexistent file)', async () => {
const target = URI.file(join(testDir, 'foo'));
const link = URI.file(join(testDir, 'bar'));
await Promises.symlink(target.fsPath, link.fsPath);
......@@ -2055,7 +2055,7 @@ flakySuite('Disk File Service', function () {
assert.ok(!error);
});
test('writeFile - no error when writing to same non-existing folder multiple times different new files', async () => {
test('writeFile - no error when writing to same nonexistent folder multiple times different new files', async () => {
const newFolder = URI.file(join(testDir, 'some', 'new', 'folder'));
const file1 = joinPath(newFolder, 'file-1');
......
......@@ -222,6 +222,6 @@ export class UnavailableResourceErrorEditor extends AbstractErrorEditor {
}
protected override getErrorMessage(): string {
return localize('unavailableResourceErrorEditorText', "The editor could not be opened due to an unavailable resource.");
return localize('unavailableResourceErrorEditorText', "The editor could not be opened because the file was not found.");
}
}
......@@ -79,6 +79,7 @@ export class BaseTextEditorModel extends EditorModel implements ITextEditorModel
get hasModeSetExplicitly(): boolean { return this._hasModeSetExplicitly; }
setMode(mode: string): void {
// Remember that an explicit mode was set
this._hasModeSetExplicitly = true;
......
......@@ -132,11 +132,11 @@ suite('Workbench status bar model', () => {
assert.strictEqual(entries[2].id, 'b');
});
test('entry with reference to other entry (not-existing)', () => {
test('entry with reference to other entry (nonexistent)', () => {
const container = document.createElement('div');
const model = new StatusbarViewModel(new TestStorageService());
// Non-Existing reference, Alignment: left
// Nonexistent reference, Alignment: left
model.add({ id: 'a', alignment: StatusbarAlignment.LEFT, name: '1', priority: { primary: 2, secondary: 1 }, container, labelContainer: container, hasCommand: false });
model.add({ id: 'b', alignment: StatusbarAlignment.LEFT, name: '2', priority: { primary: 1, secondary: 1 }, container, labelContainer: container, hasCommand: false });
......@@ -151,7 +151,7 @@ suite('Workbench status bar model', () => {
model.remove(entry);
// Non-Existing reference, Alignment: right
// Nonexistent reference, Alignment: right
entry = { id: 'c', alignment: StatusbarAlignment.RIGHT, name: '3', priority: { primary: { id: 'not-existing', alignment: StatusbarAlignment.RIGHT }, secondary: 1 }, container, labelContainer: container, hasCommand: false };
model.add(entry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册