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

Commit e588b63

Browse files
authored
Merge pull request #212 from kichristensen/FixCrashWhenOpeningSingleFile
Do not start RLS if a file is opened instead of a folder
2 parents 713387f + 3521beb commit e588b63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ export function activate(context: ExtensionContext) {
143143

144144
function startLanguageClient(context: ExtensionContext)
145145
{
146+
if (workspace.rootPath === undefined) {
147+
window.showWarningMessage('Startup error: the RLS can only operate on a folder, not a single file');
148+
return;
149+
}
146150
warnOnMissingCargoToml();
147151

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

0 commit comments

Comments
 (0)