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

Commit 440fc66

Browse files
authored
Merge pull request #210 from Green-Avocado/remove-unused-code
2 parents ab3d647 + ab3c7c4 commit 440fc66

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

lib/index.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -427,19 +427,6 @@ class RustLanguageClient extends AutoLanguageClient {
427427
// Get required dependencies
428428
await require("atom-package-deps").install("ide-rust")
429429

430-
// // Watch rls.toml file changes -> update rls
431-
// this.disposables.add(atom.project.onDidChangeFiles(events => {
432-
// if (_.isEmpty(this.projects)) return
433-
//
434-
// for (const event of events) {
435-
// if (event.path.endsWith('rls.toml')) {
436-
// let projectPath = Object.keys(this.projects).find(key => event.path.startsWith(key))
437-
// let rlsProject = projectPath && this.projects[projectPath]
438-
// if (rlsProject) rlsProject.sendRlsTomlConfig()
439-
// }
440-
// }
441-
// }))
442-
443430
// watch config toolchain updates -> check for updates if enabling
444431
this.disposables.add(
445432
atom.config.onDidChange("ide-rust.checkForToolchainUpdates", ({ newValue: enabled }) => {
@@ -500,8 +487,6 @@ class RustLanguageClient extends AutoLanguageClient {
500487
this._refreshActiveOverrides()
501488
})
502489

503-
// project.sendRlsTomlConfig()
504-
505490
this._refreshActiveOverrides()
506491
}
507492

lib/rust-project.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const path = require("path")
22
const fs = require("fs")
3-
const toml = require("toml")
43
const _ = require("underscore-plus")
54

65
/**
@@ -87,39 +86,6 @@ class RustProject {
8786
busyMessage.lastProgressTitle = title
8887
}
8988
}
90-
91-
// Send rls.toml as `workspace/didChangeConfiguration` message (or default if no rls.toml)
92-
sendRlsTomlConfig() {
93-
const rlsTomlPath = path.join(this.server.projectPath, "rls.toml")
94-
95-
fs.readFile(rlsTomlPath, (err, data) => {
96-
const config = this.defaultConfig()
97-
if (!err) {
98-
try {
99-
Object.assign(config, toml.parse(data))
100-
} catch (e) {
101-
console.warn(`Failed to read ${rlsTomlPath}`, e)
102-
}
103-
}
104-
105-
if (_.isEqual(config, this._lastSentConfig)) {
106-
return
107-
}
108-
109-
this.server.connection.didChangeConfiguration({
110-
settings: {
111-
rust: config,
112-
},
113-
})
114-
this._lastSentConfig = config
115-
})
116-
}
117-
118-
// Default Rls config according to package settings & Rls defaults
119-
/* eslint-disable-next-line class-methods-use-this */
120-
defaultConfig() {
121-
return {}
122-
}
12389
}
12490

12591
/**

0 commit comments

Comments
 (0)