Skip to content

Commit

Permalink
Add an error message, remove some prints
Browse files Browse the repository at this point in the history
  • Loading branch information
natebosch committed Jan 30, 2021
1 parent 3de130d commit 7b877e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions autoload/lsc/server.vim
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ function! s:Start(server, file_path) abort
\ ? a:server.config.WorkspaceRoot(a:file_path)
\ : lsc#file#cwd()
catch
call lsc#message#error(
\ 'Disabling workspace roots due to error: '.string(v:exception))
let l:root = lsc#file#cwd()
unlet a:server.config.WorkspaceRoot
endtry
Expand Down
6 changes: 4 additions & 2 deletions test/integration/test/workspace_folders_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ void main() {
final nextClient = testBed.clients.first;
await testBed.vim.edit('foo.txt');
await testBed.vim.sendKeys(':LSClientEnable<cr>');
print('Waiting for client');
client = await nextClient;
});

Expand All @@ -183,11 +182,14 @@ void main() {
test('does not advertise capability', () async {
final server = StubServer(client);

print('Waiting for initialization');
await server.initialized;
final initialization = await server.initialization;
expect(initialization['capabilities']['workspace']['workspaceFolders'],
false);
final messages = await testBed.vim.messages(1);
expect(messages, [
'[lsc:Error] Disabling workspace roots due to error: \'sad\'',
]);
});
});

Expand Down

0 comments on commit 7b877e1

Please sign in to comment.