-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for Fts auto Complete and docs + tests #406
base: DA-392-Add-Search-Query-Validation
Are you sure you want to change the base?
Add support for Fts auto Complete and docs + tests #406
Conversation
prajwal-pai77
commented
Jul 16, 2024
- Add support for FTS auto complete
- Add support for Documentation hover
- Add support for FTS auto complete templates
- Updated and added unit tests
1. Add KeyWords Support 2. Add Named Parameters Support 3. Add Buckets, Scope, Collections support All the above entities will now be recommended
## Describe the problem this PR is solving ## Short description of the changes -
@@ -732,7 +749,7 @@ | |||
"command": "vscode-couchbase.runSearch", | |||
"key": "ctrl+shift+e", | |||
"mac": "cmd+shift+e", | |||
"when": "(editorLangId == cbs.json || resourceFilename =~ /.cbs.json$/) && !isKVCluster" | |||
"when": "editorLangId == json && resourceFilename =~ /\\.cbs\\.json$/ && !isKVCluster && isSearchEnabled" |
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.
QQ: Do we use query to search or just the SDK?
If we directly use SDK, then probably we don't require isKVCluster check
CHANGELOG.md
Outdated
## [v2.1.0] | ||
- Add FTS workbench support inside extension | ||
- Add FTS workbench json validation | ||
- Add FTS workbench json auto complete feature | ||
- Add FTS workbench documentation | ||
|
||
## [v2.0.0] |
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.
Please add other changelogs as well for versions 2.0.1->2.0.5
@@ -746,7 +763,7 @@ | |||
{ | |||
"command": "vscode-couchbase.runSearch", | |||
"category": "Couchbase", | |||
"when": "(editorLangId == cbs.json || resourceFilename =~ /.cbs.json$/) && !isKVCluster", | |||
"when": "editorLangId == json && resourceFilename =~ /\\.cbs\\.json$/ && !isKVCluster && isSearchEnabled", |
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.
why "||" to "&&"?
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.
This is because I updated the languageId to be json it self and not cbs.json, due to which we need the conditional
"editorLangId == json && resourceFilename =~ /\.cbs\.json$/ to be true, otherwise it will trigger for all json files which is not what we want.
src/commands/fts/SearchWorkbench/contributor/autoCompleteVisitor.ts
Outdated
Show resolved
Hide resolved
src/commands/fts/SearchWorkbench/contributor/autoCompleteVisitor.ts
Outdated
Show resolved
Hide resolved
@@ -47,29 +74,52 @@ export class SearchWorkbench { | |||
await workbenchWebviewProvider.sendQueryResult(JSON.stringify([{ "status": "Executing statement" }]), { queryStatus: QueryStatus.Running }, null); | |||
const explainPlan = JSON.stringify(""); | |||
const couchbbaseRestAPI = new CouchbaseRestAPI(connection); | |||
const searchIndexesManager = connection?.cluster?.searchIndexes(); |
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.
Why no scope level indexes?
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.
This is better in this file, i feel because: queryContext?.indexName is of the format bucketName.scopeName.indexName and using scope level indexes returns just indexName. Also we will need to pass additional parameter scopeName and bucketName to this method which is unnecessary, as we can just check directly if the index is present in the cluster level or not.
Formatted using prettier, Also updated changelog to include from v2.0.1->v2.0.5 |