Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #210 from Green-Avocado/remove-unused-code
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Jan 22, 2022
2 parents ab3d647 + ab3c7c4 commit 440fc66
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 49 deletions.
15 changes: 0 additions & 15 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,19 +427,6 @@ class RustLanguageClient extends AutoLanguageClient {
// Get required dependencies
await require("atom-package-deps").install("ide-rust")

// // Watch rls.toml file changes -> update rls
// this.disposables.add(atom.project.onDidChangeFiles(events => {
// if (_.isEmpty(this.projects)) return
//
// for (const event of events) {
// if (event.path.endsWith('rls.toml')) {
// let projectPath = Object.keys(this.projects).find(key => event.path.startsWith(key))
// let rlsProject = projectPath && this.projects[projectPath]
// if (rlsProject) rlsProject.sendRlsTomlConfig()
// }
// }
// }))

// watch config toolchain updates -> check for updates if enabling
this.disposables.add(
atom.config.onDidChange("ide-rust.checkForToolchainUpdates", ({ newValue: enabled }) => {
Expand Down Expand Up @@ -500,8 +487,6 @@ class RustLanguageClient extends AutoLanguageClient {
this._refreshActiveOverrides()
})

// project.sendRlsTomlConfig()

this._refreshActiveOverrides()
}

Expand Down
34 changes: 0 additions & 34 deletions lib/rust-project.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require("path")
const fs = require("fs")
const toml = require("toml")
const _ = require("underscore-plus")

/**
Expand Down Expand Up @@ -87,39 +86,6 @@ class RustProject {
busyMessage.lastProgressTitle = title
}
}

// Send rls.toml as `workspace/didChangeConfiguration` message (or default if no rls.toml)
sendRlsTomlConfig() {
const rlsTomlPath = path.join(this.server.projectPath, "rls.toml")

fs.readFile(rlsTomlPath, (err, data) => {
const config = this.defaultConfig()
if (!err) {
try {
Object.assign(config, toml.parse(data))
} catch (e) {
console.warn(`Failed to read ${rlsTomlPath}`, e)
}
}

if (_.isEqual(config, this._lastSentConfig)) {
return
}

this.server.connection.didChangeConfiguration({
settings: {
rust: config,
},
})
this._lastSentConfig = config
})
}

// Default Rls config according to package settings & Rls defaults
/* eslint-disable-next-line class-methods-use-this */
defaultConfig() {
return {}
}
}

/**
Expand Down

0 comments on commit 440fc66

Please sign in to comment.