Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 73d8b34

Browse files
authored
Merge pull request #157 from DSpeckhals/missing-cargo-toml
Display warning message if Cargo.toml is missing
2 parents 2d725bb + 7ae81d6 commit 73d8b34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/extension.ts

+10
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ export function activate(context: ExtensionContext) {
157157

158158
function startLanguageClient(context: ExtensionContext)
159159
{
160+
warnOnMissingCargoToml();
161+
160162
window.setStatusBarMessage('RLS: starting up');
161163

162164
// FIXME(#66): Hack around stderr not being output to the window if ServerOptions is a function
@@ -194,6 +196,14 @@ export function deactivate(): Promise<void> {
194196
return Promise.resolve();
195197
}
196198

199+
function warnOnMissingCargoToml() {
200+
workspace.findFiles('Cargo.toml').then(files => {
201+
if (files.length < 1) {
202+
window.showWarningMessage('Cargo.toml must be in the workspace in order to support all features');
203+
}
204+
});
205+
}
206+
197207
function warnOnRlsToml() {
198208
const tomlPath = workspace.rootPath + '/rls.toml';
199209
fs.access(tomlPath, fs.constants.F_OK, (err) => {

0 commit comments

Comments
 (0)