-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(playground): codelens for active connection will inform about default connected database VSCODE-316 #621
chore(playground): codelens for active connection will inform about default connected database VSCODE-316 #621
Conversation
test('provide collection names completion for valid object names', async () => { | ||
const content = 'use("test"); db.'; | ||
const position = { line: 0, character: 16 }; | ||
const document = TextDocument.create('init', 'javascript', 1, content); | ||
|
||
testMongoDBService._cacheCollections('test', [{ name: 'empty' }]); | ||
|
||
const result = await testMongoDBService.provideCompletionItems({ | ||
document, | ||
position, | ||
}); | ||
const findCollectionCompletion = result.find( | ||
(item: CompletionItem) => item.label === 'empty' | ||
); | ||
expect(findCollectionCompletion).to.have.property( | ||
'kind', | ||
CompletionItemKind.Folder | ||
); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these tests (collection names completion tests) are not removed. I just moved them in a dynamic suite to test three different scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, one suggestion on reducing duplicated code
16033ac
to
cda24a9
Compare
Co-authored-by: Alena Khineika <[email protected]>
Description
Original issue highlighted in VSCODE-316 (playground should run in database specified in connection string), is not reproducible anymore. It works as expected - if no
use('database')
call is specified in playground and there is a database specified in connection string then the playground will run in the database specified in connection string.With this PR, we will now additionally highlight, in the playground, the default database that the playground will run in, if there is one specified in connection string.
mongodb+srv://<credentials>@host
mongodb+srv://<credentials>@host/countries
We additionally also provide autocomplete for the collection names on the
db
object when connected using a connection string with default database and there is no explicituse('DB')
call in the playground.Checklist
Motivation and Context
Open Questions
Dependents
Types of changes