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

Remove unused rls.toml code #210

Merged
merged 2 commits into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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