question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use an enum for OS Types

See original GitHub issue

Current we use boolean values to determine whether os is one of Mac, Windows or Linux. Should consider using an Enum. This could result in a number of changes, however I believe it is worth, and needs to be done. Using 3 booleans doesn’t work well, when all of them are mutually exclusive.

Suggestion:

export enum OS {
	Linux = 'Linux',
	Mac = 'Mac',
	Windows = 'Windows'
}

@Microsoft/pvsc-team

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, Jul 24, 2018

@DonJayamanne depends on what we use the enum for. 😉 I mean we won’t be able to rely on something being Windows to get the path stuff right, but VS Code will be running on Windows itself, so it’s possible we will need it. (I’m not suggesting we start with it now, just something we may need to think about in the future.)

0reactions
d3r3kkcommented, Jan 3, 2019

This has been around for some time, see client/common/utils/platform.ts

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Representing OS as Enum - Stack Overflow
My gut was to use an enum for this representation (e.g. OS.VistaSp1, OS.Win7, etc.) but since we also support several OS types (Mac,...
Read more >
Enumerations - a free Hacking with Swift tutorial
Enumerations – usually just called “enum” and pronounced “ee-num” - are a way for you to define your own kind of value in...
Read more >
Enums in swift - Abhimuralidharan - Medium
An enumeration is a data type consisting of a set of named values, ... You could use the enum with defined values if...
Read more >
enum in Java - GeeksforGeeks
A Java enumeration is a class type. Although we don't need need to instantiate an enum using new, it has the same capabilities...
Read more >
OS (JUnit 5.2.0 API)
Enumeration of common operating systems used for testing Java applications. If the current operating system cannot be detected — for example, if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found