Skip to content
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

Open
wants to merge 27 commits into
base: DA-392-Add-Search-Query-Validation
Choose a base branch
from

Conversation

prajwal-pai77
Copy link
Collaborator

  • Add support for FTS auto complete
  • Add support for Documentation hover
  • Add support for FTS auto complete templates
  • Updated and added unit tests

@@ -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"
Copy link
Collaborator

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
Comment on lines 3 to 9
## [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]
Copy link
Collaborator

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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "||" to "&&"?

Copy link
Collaborator Author

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.

@@ -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();
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@prajwal-pai77
Copy link
Collaborator Author

Formatted using prettier, Also updated changelog to include from v2.0.1->v2.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants