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

Commit

Permalink
remove sendRlsTomlConfig function
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Avocado committed Dec 2, 2021
1 parent 9c54b52 commit ab3c7c4
Showing 1 changed file with 0 additions and 34 deletions.
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 ab3c7c4

Please sign in to comment.