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

Do not show completions inside comments #974

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

miqm
Copy link
Collaborator

@miqm miqm commented Nov 22, 2020

  • Detecting if we're inside a comment by checking if current offset is in a SyntaxTrivia and that trivia is a comment type
  • If so, do not try to build completions, as it's pointless - return BicepCompletionContextKind.None

Fixes #970
Fixes #576

@codecov-io
Copy link

codecov-io commented Nov 22, 2020

Codecov Report

Merging #974 (75f8d55) into main (fa6e2c5) will increase coverage by 0.00%.
The diff coverage is 96.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #974   +/-   ##
=======================================
  Coverage   94.33%   94.33%           
=======================================
  Files         316      317    +1     
  Lines       14771    14800   +29     
  Branches       12       12           
=======================================
+ Hits        13934    13962   +28     
- Misses        837      838    +1     
Flag Coverage Δ
dotnet 94.93% <96.66%> (+<0.01%) ⬆️
typescript 25.78% <ø> (ø)

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

Impacted Files Coverage Δ
...rc/Bicep.Core/Navigation/SyntaxTriviaExtensions.cs 94.44% <94.44%> (ø)
...ngServer.UnitTests/BicepCompletionProviderTests.cs 100.00% <100.00%> (ø)
...p.LangServer/Completions/BicepCompletionContext.cs 96.24% <100.00%> (+0.07%) ⬆️
src/Bicep.Core/Emit/ScopeHelper.cs 92.38% <0.00%> (ø)
src/Bicep.Core/Syntax/SyntaxTree.cs 100.00% <0.00%> (ø)
src/Bicep.Core/Emit/TemplateEmitter.cs 100.00% <0.00%> (ø)
src/Bicep.Core.UnitTests/Utils/ParserHelper.cs 100.00% <0.00%> (ø)
src/Bicep.Core/Syntax/ModuleDeclarationSyntax.cs 100.00% <0.00%> (ø)
src/Bicep.Core.UnitTests/Utils/TestSyntaxHelper.cs 100.00% <0.00%> (ø)
...ypeSystem/TypeValidatorCompileTimeConstantTests.cs 100.00% <0.00%> (ø)
... and 85 more

@majastrz
Copy link
Member

Thanks for sending the fix for this!

@majastrz majastrz merged commit 5b0314c into Azure:main Nov 23, 2020
@miqm miqm deleted the ignore-intellisense-on-comments branch November 23, 2020 19:58
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.

VSCode gives hints after space when writing comments Completions should not appear inside comments
3 participants