Skip to content

Commit

Permalink
fix: use accurate type comparisons and remove unused reject parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jul 17, 2021
1 parent e52839f commit dfe5b0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/debugger/RemoteDebuggerCommandService.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function observeAttachDebugTargets(): ConnectableObservable<Array<PythonD
}

function isPortUsed(port: number): Promise<boolean> {
const tryConnectPromise = new Promise((resolve, reject) => {
const tryConnectPromise = new Promise((resolve) => {
const client = new net.Socket()
client
.once("connect", () => {
Expand Down Expand Up @@ -134,7 +134,7 @@ function handleJsonRequest(body, res) {
const port = Number(body.port)
getLogger().info("Remote debug target attach request", body)
const target = attachReady.get(port)
if (target != null) {
if (target !== undefined) {
debugRequests.next({
type,
command,
Expand Down
6 changes: 3 additions & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PythonLanguageClient extends AutoLanguageClient {

onSpawnError(err) {
const description =
err.code == "ENOENT"
err.code === "ENOENT"
? `No Python interpreter found at \`${this.python}\`.`
: `Could not spawn the Python interpreter \`${this.python}\`.`
atom.notifications.addError("`ide-python` could not launch your Python runtime.", {
Expand All @@ -88,7 +88,7 @@ class PythonLanguageClient extends AutoLanguageClient {
}

onSpawnClose(code, signal) {
if (code !== 0 && signal == null) {
if (code !== 0 && signal === null) {
atom.notifications.addError("Unable to start the Python language server.", {
dismissable: true,
buttons: [
Expand Down Expand Up @@ -124,7 +124,7 @@ class PythonLanguageClient extends AutoLanguageClient {
}

createTimeoutPromise(milliseconds) {
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
const timeout = setTimeout(() => {
clearTimeout(timeout)
this.logger.error(`Server failed to shutdown in ${milliseconds}ms, forcing termination`)
Expand Down

0 comments on commit dfe5b0d

Please sign in to comment.