Skip to content

Conversation

@dobladez
Copy link
Contributor

@dobladez dobladez commented Dec 28, 2020

What does this PR do?

Add smart code-completion for WHERE clause expressions.

  • Complete operators based on type of field
  • Complete literal values based on type of field (handles boolean, picklists)
  • Offer NULL as a completion value only if operator in context allows nulls, and if field is nillable.

Also: Refactoring of "placeholder" completion items: send JSON data instead of parseable values inside item label string.

NOTE 1: Depends on VS Code extension branch: feature/soql-code-completion-WHERE

NOTE 2: This PR is on top of #107 (branch feature/code-completion-ORDER_BY)

What issues does this PR fix or reference?

W-8597428

@codecov
Copy link

codecov bot commented Dec 28, 2020

Codecov Report

Merging #112 (9ffffb4) into develop (55b2d08) will increase coverage by 0.67%.
The diff coverage is 98.76%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #112      +/-   ##
===========================================
+ Coverage    86.94%   87.61%   +0.67%     
===========================================
  Files           46       46              
  Lines         1409     1470      +61     
  Branches       310      334      +24     
===========================================
+ Hits          1225     1288      +63     
+ Misses         182      180       -2     
  Partials         2        2              
Flag Coverage Δ
language-server 98.65% <98.76%> (+1.18%) ⬆️
soql-builder-ui 92.41% <ø> (ø)
soql-model 80.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...guage-server/src/completion/soql-query-analysis.ts 95.58% <96.66%> (ø)
packages/language-server/src/completion.ts 100.00% <100.00%> (+2.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55b2d08...9ffffb4. Read the comment docs.

@dobladez
Copy link
Contributor Author

dobladez commented Dec 28, 2020

soqlCompletionWHERE_3.mov
soqlCompletionWHERE_dateliterals.mov

@dobladez dobladez changed the title Feature/code completion where Code-completion for WHERE clause expressions Jan 4, 2021
Base automatically changed from feature/code-completion-ORDER_BY to develop January 6, 2021 22:06
@dobladez dobladez force-pushed the feature/code-completion-WHERE branch from 2a05347 to b3c5a0d Compare January 6, 2021 23:28
@dobladez dobladez force-pushed the feature/code-completion-WHERE branch from b3c5a0d to d84ea24 Compare January 14, 2021 17:46
@jgellin-sf
Copy link
Contributor

QA complete.

@jgellin-sf jgellin-sf merged commit ed869fc into develop Jan 15, 2021
@jgellin-sf jgellin-sf deleted the feature/code-completion-WHERE branch January 15, 2021 19:12
dehru added a commit that referenced this pull request Jan 15, 2021
* model WHERE clause (#68)
* Remote SOQL Errors - Language Server Part (#93)
* remove code builder (#92)
* Move from antlr4JS to antlr4TS (#96)
* SOQL code completion for SELECT fields (#99)
* publish language server 0.2.9 (#102)
* Fix LSP dependency (#104)
* Disabled 'Running...' button while query running (#106)
* Add basic code-completion for ORDER BY and other improvements (#107)
* Dehru and JG telemetry - Send GDPR clean data to telemetry when errors/unsupported syntax present (#110)
* Disable WHERE in model (#113)
* Bump versions for publishing (#114)
* Code-completion for WHERE clause expressions (#112)
Co-authored-by: Jonathan Gellin <jgellin@salesforce.com>
Co-authored-by: jgellin-sf <55159130+jgellin-sf@users.noreply.github.com>
Co-authored-by: Chase McCarthy <charles.mccarthy@heroku.com>
Co-authored-by: Jonny Hork <jhork@salesforce.com>
Co-authored-by: Fernando Dobladez <fernandodobladez@salesforce.com>
Co-authored-by: Jonathan Gellin <jgellin@salesforce.com>
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