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

Display warning message if Cargo.toml is missing #157

Merged
merged 1 commit into from
Sep 22, 2017
Merged
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
10 changes: 10 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export function activate(context: ExtensionContext) {

function startLanguageClient(context: ExtensionContext)
{
warnOnMissingCargoToml();

window.setStatusBarMessage('RLS: starting up');

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

function warnOnMissingCargoToml() {
workspace.findFiles('Cargo.toml').then(files => {
if (files.length < 1) {
window.showWarningMessage('Cargo.toml must be in the workspace in order to support all features');
}
});
}

function warnOnRlsToml() {
const tomlPath = workspace.rootPath + '/rls.toml';
fs.access(tomlPath, fs.constants.F_OK, (err) => {
Expand Down