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

Support private module completions #16051

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

StephenWeatherford
Copy link
Contributor

@StephenWeatherford StephenWeatherford commented Jan 9, 2025

Fixes #9038

Microsoft Reviewers: Open in CodeFlow

@StephenWeatherford StephenWeatherford changed the title Support private module completions [WIP] Support private module completions Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Test this change out locally with the following install scripts (Action run 13185943053)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 13185943053
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 13185943053"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 13185943053
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 13185943053"

Copy link
Contributor

github-actions bot commented Jan 9, 2025

Dotnet Test Results

    78 files   -     39      78 suites   - 39   35m 15s ⏱️ - 14m 5s
11 764 tests +    21  11 764 ✅ +    21  0 💤 ±0  0 ❌ ±0 
27 286 runs   - 13 536  27 286 ✅  - 13 536  0 💤 ±0  0 ❌ ±0 

Results for commit d809ec0. ± Comparison against base commit 93c5975.

This pull request removes 1842 and adds 692 tests. Note that renamed tests count towards both.

		nestedProp1: 1
		nestedProp2: 2
		prop1: true
		prop2: false
	1
	2
	\$'")
	prop1: true
	prop2: false
…
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
�ӽ\u000e� \u0010\u0007p�>�O�w\u0008\u001c\u000e�\u001d�
�5�G�F15i��šI\u0007M\u0017�M�o�p@�<��~[�Cٴ�P锳�A��\u001c]\u001f�B��\u0002\u000cH��;�g�dD�zۄQ�8�\u0007	�X���\u0002)3F\u001bM\u0019�U.�4�P�O�0�Z�,:wq���s[����jX��Ѩ����\u0013}�?�`(I���\u0000C�Q��E2����?֞ ��(Z�\u0013�2\u0005?\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��K
�0\u0010\u0006�=E�\u0001b��U�{7�\u001b\u000f\u0010�\u0011+��&BA���Bܴ��C0�2�C&	\u0013�ޛf\u000b&��\u0012ń\\u001346ڒ���w\u0018W��7��\u0012�!���;�q���m+s���B���\u000bH����Z*NB�b\u001eG���\u000e�X�+��I^fА���]�\u0018�/}Lo������o�O#��?@��F���Jѥ�,3�����������A���\u0008u��'s��\�7��<o:/\u0019��\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��M\u000b�0\u0018\u0007��\u0014�\u0007�{�^,�\u0010t�\u0008\u000b��1r��\u0016j �囇�t�%h�����m�\u001f��U��*�E�%p�a�7b\u0008�Z�\u001b�$\u0002�F\u0010�\\u0000BN�{'-\u001ee�
��\u0018g� \u001a8�J3\u001d��@\u0004B2\u000c�|���읻�`��Uu	�<�5����)Ϻʧ�������=ѷ�\u0013ʐ�\u0001\u001c(�%��\u0008�|��Q2�����Q|\n��is����1\u0013x�,˲��\u0000ijCf\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003�ӽ
�0\u0010\u0007��>E�\u0003Ĥi�V��"��\u0000�=�bki*\u0004�w7\u001dĥť\u001f������p��z��\u0016t\u000e�!\$ᚠ�QGFQ�{��\u001aSo\u0014Q%�D\u0008��7�q7�n�*s��A�º-JH��q,c!\u0013�X"�X�R6Pb	�u{N�*\u0007K.�Vu��@����}.8݌o����?R���\u000b�\u0010���Ƴd�������\u0002[C�B���\u0008M��'}5�\z7��<o:/�f2�\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003�ӽ\u000e�0\u0010\u0007��>\u0005OP�\[\u0007vG_�Q\u0012?B1\u0002������\u0001�`b�c������t�M��ŵ��הJ15\u0008t�
���Q�y\u0001\u0001�9�N��7\u0019�֍��U����&�9�E�FY�-k+�jB�U��Fk�\\s�[�����S]���\u001ckX��Ѡ���֌O�\u0007 ��a$P���#��Y2����?�� ��(Z�\u0013\u0019Xr�\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��M\u000b�0\u0018\u0007��\u0014�\u000f0�>
<\u0004\u001d2��k�\u001cd��\u001a\u0008}��!�(]Ԃ�;�y`�6�C�N7+�SSV����\u0008\u000c
[����\u0016�5�^0�J\u0008	\u0000l\u0006��ý�uiG�b�\u001fD\u0015�u���(\u0016\u00042\u00102D���`3[:��H\u0008o�>GY��\u0006]�k�v�=��>��������)����s%\u0008�L0\u0002�\u0014���O��?��Ë��b\u0013/���6�����ߞ�q\u001c�\u0019�\u0013����\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_banned_function_replacement ("createArray(1, 2, 3)","array","[
  1
  2
  3
]")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_banned_function_replacement ("createObject('key', 'value')","object","{
  key: 'value'
}")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_strings_with_newlines ("
","\n")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_strings_with_newlines ("
","\r\n")
…

♻️ This comment has been updated with latest results.

@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 5 times, most recently from a447698 to 479ed50 Compare January 16, 2025 00:47
@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 4 times, most recently from af65f40 to 5ea8c28 Compare January 24, 2025 18:56
@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 3 times, most recently from d940471 to 704815e Compare January 31, 2025 00:42
@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 6 times, most recently from d72f18b to 657444f Compare February 5, 2025 23:51
@StephenWeatherford StephenWeatherford changed the title [WIP] Support private module completions Support private module completions Feb 5, 2025
/// <summary>
/// Provider to get metadata for modules stored in a public or private registry.
/// </summary>
public abstract class BaseModuleMetadataProvider(
Copy link
Contributor Author

@StephenWeatherford StephenWeatherford Feb 6, 2025

Choose a reason for hiding this comment

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

Most of this code was simply moved from the old PublicModuleMetadataProvider, see below

@@ -39,33 +46,115 @@ private enum ModuleCompletionPriority
FullPath = 2, // br:, ts:
}
Copy link
Contributor Author

@StephenWeatherford StephenWeatherford Feb 6, 2025

Choose a reason for hiding this comment

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

The old code was quite complex. I rewrote large portions of it, combining the public and private cases in most places, and also combining the handling of aliased vs fully-qualified by moving all the parsing code to a single private class. A lot of code simply went away.

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.

Support ACR (private) module reference completions
1 participant