Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSystemProvide API should declare enums starting with 1 #35449

Closed
dbaeumer opened this issue Oct 1, 2017 · 3 comments
Closed

FileSystemProvide API should declare enums starting with 1 #35449

dbaeumer opened this issue Oct 1, 2017 · 3 comments
Assignees
Labels
api debt Code quality issues remote Remote system operations issues
Milestone

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Oct 1, 2017

The type in question is:

	export enum FileType {
		File = 0,
		Dir = 1,
		Symlink = 2
	}

Having 0 as a value only causes problems with default interpretation and the absence of properties. I only use 0 if this is equal to the property no being there.

@vscodebot vscodebot bot added the api label Oct 1, 2017
@jrieken jrieken added the remote Remote system operations issues label Oct 2, 2017
@jrieken jrieken added this to the October 2017 milestone Oct 2, 2017
@jrieken
Copy link
Member

jrieken commented Oct 2, 2017

Yeah, makes sense

@siegebell
Copy link

siegebell commented Oct 17, 2017

It also needed documentation :) -- I wasn't sure whether it was describing bit flags or discrete options until vscode gave me errors for describing a file as a Symlink but not allowing readdir.

@jrieken jrieken removed this from the October 2017 milestone Oct 27, 2017
@jrieken jrieken added the debt Code quality issues label Nov 13, 2017
@jrieken jrieken added this to the April 2018 milestone Apr 5, 2018
@jrieken
Copy link
Member

jrieken commented Apr 6, 2018

Started on this... @siegebell Do you have a preference? I have some changes in joh/fs-next that allow for a bit mask but maybe discrete options are better. (I have a preference for the latter)

export enum FileType {
  File = 1,
  Dir = 2,
  Symlink = 64
}
export interface FileStat {
  mtime: number;
  size: number;
  type: FileType;
}

or

export enum FileType {
  File = 1,
  Dir = 2,
}
export interface FileStat {
  mtime: number;
  size: number;
  type: FileType;
  isSymlink: boolean;
}

jrieken added a commit that referenced this issue Apr 6, 2018
@jrieken jrieken closed this as completed Apr 10, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api debt Code quality issues remote Remote system operations issues
Projects
None yet
Development

No branches or pull requests

3 participants