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

Task: refactor extensions file #5160

Draft
wants to merge 223 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
f62c322
add tree view
ElinorW Apr 3, 2024
f62cdfa
add Api files conatiner and remove previous containers
ElinorW Apr 11, 2024
45d5b42
rename workspace title
ElinorW Apr 15, 2024
d9b921f
combine search and open description functions
ElinorW Apr 16, 2024
59b662a
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Apr 17, 2024
1a1d1c4
Add 'close description' button to api title node
ElinorW Apr 17, 2024
1431b90
add close description dialog
ElinorW Apr 17, 2024
9c84f5c
add generate option step
ElinorW Apr 17, 2024
df0618f
added plugin dialog steps
ElinorW Apr 22, 2024
3678c34
added icon toggling
ElinorW Apr 22, 2024
50f73ea
add workspace.json file to workspace
ElinorW Apr 23, 2024
866fbd1
Merge branch 'feature/plugin' into elinor/add-kiota-workspace
ElinorW Apr 23, 2024
75eb6df
Fix some server configs
Apr 26, 2024
58cb7e3
Merge remote-tracking branch 'origin/main' into elinor/add-kiota-work…
Apr 26, 2024
0b460d4
Merge branch 'main' into elinor/add-kiota-workspace
baywet Apr 26, 2024
ff8f0fa
Ensure the RPC commands use preview features if config is enabled.
Apr 26, 2024
ab2f99e
- updates references kiota version for CLI
baywet Apr 26, 2024
d3947b3
- cleans up localization files from unused resource
baywet Apr 26, 2024
d440b29
- removes unimplemented command
baywet Apr 26, 2024
807fc00
- adds the environment variable passing to the json RPC server
baywet Apr 26, 2024
e93920f
- refactors to constant
baywet Apr 26, 2024
cc0f413
- removes serializers in preview mode
baywet Apr 26, 2024
e71d83f
- code linting
baywet Apr 26, 2024
cd183a0
- initial plugin generation
baywet Apr 26, 2024
9c80f34
Merge pull request #4562 from microsoft/andrueastman/fixExtensionRpcs
andrueastman Apr 30, 2024
0e151b0
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Apr 30, 2024
161bae1
Fixed the collection of plugin name
Apr 30, 2024
fc6148f
Merge branch 'main' into elinor/add-kiota-workspace
andrueastman May 2, 2024
8b3ec49
Merge branch 'main' into elinor/add-kiota-workspace
baywet May 2, 2024
88dde13
rename title string
ElinorW May 2, 2024
056540d
Add plugin type step
ElinorW May 2, 2024
9bb134d
add generate a manifest type
ElinorW May 2, 2024
aa45716
close description after generation
ElinorW May 2, 2024
2c42eda
add "Edit Path' button
ElinorW May 8, 2024
564ed03
add regenerate call
ElinorW May 8, 2024
4174297
update file name
ElinorW May 8, 2024
9e8e8d9
enable editing paths on api explorer
ElinorW May 8, 2024
236fae6
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 9, 2024
8b629ab
add regenerate functionality
ElinorW May 9, 2024
f781016
Merge branch 'main' into elinor/add-kiota-workspace
baywet May 10, 2024
5db4e6d
- bumps kiota versions to avoid updates which confuses @sebastienleve…
baywet May 10, 2024
6d1d8b6
- adds FAQ documentation for vs code reinstalling over
baywet May 10, 2024
b03f5b2
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 13, 2024
2bebba5
add regeneration button on api explorer
ElinorW May 13, 2024
b21736a
remove automatic workspace.json file add
ElinorW May 13, 2024
3bcc0e6
replace string
ElinorW May 14, 2024
45afefd
update icon
ElinorW May 14, 2024
93c3b13
add plugin re-generation
ElinorW May 14, 2024
d187094
add warning notification
ElinorW May 14, 2024
cb2ef16
add save notification
ElinorW May 14, 2024
2773039
fix delete description appearing on wrong nodes
ElinorW May 16, 2024
38a1a65
remove open file command
ElinorW May 16, 2024
f34a458
remove output path validation and default to ouptut folder
ElinorW May 16, 2024
0e325f9
move constants to separate file
ElinorW May 16, 2024
f173582
Merge branch 'main' into elinor/add-kiota-workspace
baywet May 16, 2024
8688a3c
remove path autoselection when description is loaded for the first time
ElinorW May 16, 2024
6fa3212
fix workspace.json file not opening
ElinorW May 16, 2024
dbb8e27
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW May 16, 2024
2e7d4df
hide add and remove icon on apiTitle node
ElinorW May 16, 2024
5bfe675
undo closing descriptions after generation
ElinorW May 17, 2024
aaddbfd
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 17, 2024
3d49d8d
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW May 17, 2024
6f1c049
Adding the automatic sideloading script
sebastienlevert May 17, 2024
1fce6c8
Update to using vsx
sebastienlevert May 17, 2024
2a0db34
fix icons display
ElinorW May 20, 2024
18d6b2b
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 20, 2024
2bbf301
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 20, 2024
1768c4d
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW May 20, 2024
9b5c9be
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 21, 2024
669348d
remove welcome translations
ElinorW May 21, 2024
65558cb
remove welcome string translation
ElinorW May 21, 2024
7b03451
add string translations
ElinorW May 21, 2024
3476f3f
remove unused search lock function
ElinorW May 21, 2024
858d4cd
add french translations
ElinorW May 21, 2024
e877581
added czech translations
ElinorW May 21, 2024
8f4a32f
add portuguese translations
ElinorW May 21, 2024
284e59d
update output diectory string
ElinorW May 21, 2024
d0ec92f
set workspace file constant
ElinorW May 21, 2024
74aaf10
add else clause
ElinorW May 21, 2024
d513b8a
remove TODO comments
ElinorW May 21, 2024
07ceaa4
return vscode error
ElinorW May 21, 2024
77cba1e
add types
ElinorW May 21, 2024
6c8f59c
use nullish coalescing operator instead of Logical OR
ElinorW May 21, 2024
cb3513e
add spanish translations
ElinorW May 22, 2024
d5823aa
add italian translation
ElinorW May 22, 2024
8dd5e5c
add chinese translations
ElinorW May 22, 2024
a880d30
remove unused functions
ElinorW May 22, 2024
cbd508e
update static strings
ElinorW May 22, 2024
bf1e227
add missing l10n
ElinorW May 22, 2024
1650da1
update string typo
ElinorW May 22, 2024
8377932
update static string localization files
ElinorW May 22, 2024
6ebfac1
update french string
ElinorW May 22, 2024
469108d
remove else
ElinorW May 23, 2024
bc03997
Merge branch 'main' into elinor/add-kiota-workspace
baywet May 23, 2024
a45c61d
Merge pull request #4676 from sebastienlevert/sebastienlevert/sideloa…
baywet May 23, 2024
e2cfdf8
add plugin output selection
ElinorW May 23, 2024
9551fa8
add output directory selection for client generation
ElinorW May 23, 2024
4730105
add output directory selection for manifest generation
ElinorW May 23, 2024
22cf4a2
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW May 23, 2024
2634835
Merge branch 'main' into elinor/add-kiota-workspace
andrueastman May 24, 2024
8e0d429
add polish translations
ElinorW May 24, 2024
b98b8c1
add russian translations
ElinorW May 24, 2024
880a61b
add swahili translations
ElinorW May 24, 2024
337856e
add success message and toggle icons
ElinorW May 24, 2024
d969270
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW May 24, 2024
fe57457
add constants
ElinorW May 24, 2024
d14cdab
localize string
ElinorW May 27, 2024
c3de6d2
add default and browse output options
ElinorW May 27, 2024
972b8e3
add dropdown for api path selection
ElinorW May 29, 2024
94f713e
remove unused filter property
ElinorW May 29, 2024
c63339a
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 29, 2024
d86275b
remove else
ElinorW May 30, 2024
2045df0
Merge pull request #4742 from microsoft/elinor/add-api-path-selection
ElinorW May 30, 2024
ccdc4e4
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW May 30, 2024
d3a2b11
update icon
ElinorW May 30, 2024
6258833
Fixing vscode sideloading script for Windows
sebastienlevert Jun 3, 2024
1fd3f7e
Merge branch 'microsoft:elinor/add-kiota-workspace' into elinor/add-k…
sebastienlevert Jun 3, 2024
2c32919
enable generation from a deeplink
ElinorW Jun 4, 2024
6285127
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jun 4, 2024
5d58b7c
Merge branch 'andrueastman/renamePlugin' into andrueastman/renamePlug…
Jun 5, 2024
0e05d3a
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jun 5, 2024
a16590e
Merge remote-tracking branch 'origin/main' into andrueastman/renamePl…
Jun 5, 2024
8cc6fb4
Updates plugin naming
Jun 5, 2024
c703500
Merge branch 'main' into elinor/add-kiota-workspace
andrueastman Jun 5, 2024
45acf73
Merge remote-tracking branch 'origin/elinor/add-kiota-workspace' into…
Jun 5, 2024
9e3cb83
Merge pull request #4764 from sebastienlevert/elinor/add-kiota-workspace
andrueastman Jun 5, 2024
6a32fd0
Merge branch 'main' into elinor/add-kiota-workspace
andrueastman Jun 6, 2024
6b92cb3
Merge branch 'elinor/add-kiota-workspace' into andrueastman/renamePlu…
andrueastman Jun 6, 2024
521a828
Merge pull request #4787 from microsoft/andrueastman/renamePluginCode
ElinorW Jun 6, 2024
b55e24f
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jun 10, 2024
def06cf
update vscode engine
ElinorW Jun 10, 2024
b2193e4
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jun 12, 2024
c0ad798
bump kiota extension version
ElinorW Jun 12, 2024
4c97bf4
Task: Display client/plugin name on API explorer (#4801)
ElinorW Jun 13, 2024
f6280cb
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jun 13, 2024
a357533
hide information messages
ElinorW Jun 13, 2024
8654d3d
update warning message display
ElinorW Jun 13, 2024
9de1511
Merge branch 'main' into elinor/add-kiota-workspace
baywet Jun 13, 2024
658d832
Merge branch 'main' into elinor/add-kiota-workspace
baywet Jun 18, 2024
d1f1c86
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jun 27, 2024
660048d
update regenerate function
ElinorW Jun 28, 2024
395a42b
Add constants
ElinorW Jun 28, 2024
361d3ae
Fix: "Override" message only displays if there's a change on the tree…
ElinorW Jun 28, 2024
af0cd0b
Merge branch 'elinor/add-kiota-workspace' into elinor/fix-regeneratio…
ElinorW Jun 28, 2024
d975dc3
code clean up
ElinorW Jul 1, 2024
21d3c70
Merge branch 'elinor/fix-regeneration-issue' of https://github.com/mi…
ElinorW Jul 1, 2024
9a17b52
update plugin type to accept array
ElinorW Jul 1, 2024
7db3e0c
Merge pull request #4904 from microsoft/elinor/fix-regeneration-issue
baywet Jul 2, 2024
b38066e
Merge pull request #4917 from microsoft/elinor/multiple-plugin-support
baywet Jul 2, 2024
03edf32
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jul 2, 2024
30d12af
Merge branch 'main' into elinor/add-kiota-workspace
baywet Jul 3, 2024
1ef763a
Merge branch 'main' into elinor/add-kiota-workspace
baywet Jul 4, 2024
f195c6e
chore: lock update
baywet Jul 4, 2024
7eba6f6
Merge branch 'main' into elinor/add-kiota-workspace
baywet Jul 5, 2024
099f0a3
chore: bumps version to avoid auto-update
baywet Jul 5, 2024
bee1633
Merge remote-tracking branch 'origin/main' into elinor/add-kiota-work…
Jul 11, 2024
868b14c
Fixes unselected paths
Jul 11, 2024
10dd282
format
Jul 11, 2024
a2a205d
Merge branch 'main' into elinor/add-kiota-workspace
baywet Jul 11, 2024
4fc7dd3
Merge pull request #4960 from microsoft/andrueastman/fixMissingNodes
andrueastman Jul 11, 2024
15064a4
fix regeneration
ElinorW Jul 12, 2024
9aca89e
Merge branch 'main' into elinor/add-kiota-workspace
andrueastman Jul 15, 2024
fc3a34e
API change to migrate lockfile to workspace file
Jul 15, 2024
5097c03
Adds connections to migrate workspace file
Jul 15, 2024
affd017
Merge pull request #4973 from microsoft/andrueastman/migrateHandler
baywet Jul 15, 2024
49df293
Fix path maching
Jul 16, 2024
476ba16
Update vscode/microsoft-kiota/src/openApiTreeProvider.ts
baywet Jul 16, 2024
dd35ec6
Merge pull request #4981 from microsoft/andrueastman/fixFiltering
baywet Jul 16, 2024
7035889
Merge branch 'main' into elinor/add-kiota-workspace
andrueastman Jul 17, 2024
19366c7
Fixes plugin generation check
Jul 17, 2024
f0d3d97
Merge pull request #4989 from microsoft/andrueastman/fixpluginGeneration
baywet Jul 17, 2024
7ffb864
Fix: Add paste path functionality (#4994)
ElinorW Jul 22, 2024
1ca7aff
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jul 25, 2024
cbea6da
Fix: Kiota extension works without a workspace folder open (#4958)
ElinorW Jul 26, 2024
5df07fe
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jul 26, 2024
22089d6
Merge branch 'main' into elinor/add-kiota-workspace
baywet Jul 26, 2024
c6d2789
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Jul 29, 2024
72e3f8b
Fix: Workspace file display (#5029)
ElinorW Jul 29, 2024
48f3d9f
Fix: Display "override" message only when changes have been made (#5048)
ElinorW Aug 1, 2024
8d24ff9
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 1, 2024
f3b649a
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 7, 2024
3f85f95
fix typo issue
ElinorW Aug 7, 2024
c340bbf
fix typecase
ElinorW Aug 7, 2024
211335f
fix cwd update
ElinorW Aug 7, 2024
030fa62
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 8, 2024
8741217
Merge branch 'main' into elinor/add-kiota-workspace
baywet Aug 9, 2024
dd99a3f
Merge branch 'main' into elinor/add-kiota-workspace
baywet Aug 12, 2024
c900844
chore: bumps extension engine version
baywet Aug 12, 2024
2178d47
chore: updates lock file
baywet Aug 12, 2024
67bbbb1
Merge branch 'main' into elinor/add-kiota-workspace
baywet Aug 13, 2024
8fda776
extract kiota status command
thewahome Aug 13, 2024
b587e70
extract open api tree node commands
thewahome Aug 13, 2024
06e61fa
generate command extraction
thewahome Aug 13, 2024
c850a24
use abstract class to ensure consistency
thewahome Aug 14, 2024
71a53a8
create SearchOrOpenApiDescriptionCommand
thewahome Aug 14, 2024
f695e05
create close description command
thewahome Aug 14, 2024
5d4e938
create FilterDescriptionCommand
thewahome Aug 14, 2024
fd2a938
create EditPathsCommand
thewahome Aug 14, 2024
202830a
create regenerate button command
thewahome Aug 14, 2024
e52f966
create RegenerateCommand
thewahome Aug 14, 2024
50da7c5
implement regenerate command
thewahome Aug 14, 2024
6117e87
format extensions
thewahome Aug 14, 2024
4c1060e
open api tree node commands
thewahome Aug 14, 2024
239431f
create update clients command
thewahome Aug 14, 2024
1c9346c
create display generation results command
thewahome Aug 14, 2024
86fa5ec
create select lock command
thewahome Aug 14, 2024
1d89fb4
create uri handler
thewahome Aug 14, 2024
d7dea43
arrange providers in providers folder
thewahome Aug 14, 2024
a65e7a7
move codelens to the providers folder
thewahome Aug 14, 2024
6d4b92e
move getKiotaVersion to utilities folder
thewahome Aug 14, 2024
44b330d
organise subscriptions
thewahome Aug 14, 2024
c3ff57d
provide command name in command
thewahome Aug 14, 2024
07dbf83
extract reporter to reusable file
thewahome Aug 14, 2024
9cf8171
fix imports
thewahome Aug 14, 2024
b16dfb8
new up the Telemetry importer
thewahome Aug 14, 2024
10091c4
remove telemetry folder
thewahome Aug 14, 2024
90b8381
Merge branch 'elinor/add-kiota-workspace' into task/refactor-extensio…
thewahome Aug 14, 2024
8f5f368
Feat: Add migration dialog (#5144)
ElinorW Aug 15, 2024
b9881af
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 15, 2024
acbb73f
enable execute to run sync and async
thewahome Aug 15, 2024
ebd38cf
Merge branch 'elinor/add-kiota-workspace' into task/refactor-extensio…
thewahome Aug 15, 2024
f47a10f
chore: adds missing french translations
baywet Aug 15, 2024
5074b65
Merge branch 'elinor/add-kiota-workspace' into task/refactor-extensio…
thewahome Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions scripts/execute-vscode-sideload.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
param (
[string]
[Parameter(Mandatory = $false)]
$Platform = "win-x64",
[switch]
$WSL
)


Push-Location ./vscode/microsoft-kiota

# Install all dependencies
npm i

# Package the VS Code extension
npx @vscode/vsce package

# Getting package for its version
$PackageJson = Get-Content "package.json" -Raw | ConvertFrom-Json

# Install the extension
code --install-extension "./kiota-$($PackageJson.version).vsix"

$VsCodeRootPath = (Resolve-Path "~/.vscode").Path

if ($WSL) {
$Platform = "linux-x64"
$VsCodeRootPath = (Resolve-Path "~/.vscode-server").Path
}

$KiotaBin = "$VsCodeRootPath/extensions/ms-graph.kiota-$($PackageJson.version)/.kiotabin/$($PackageJson.kiotaVersion)/$Platform"

Pop-Location

# Building Kiota
dotnet publish ./src/kiota/kiota.csproj -p:PublishSingleFile=true -p:PublishReadyToRun=true --self-contained -c Release -r $platform -o $KiotaBin
5 changes: 3 additions & 2 deletions src/kiota/Rpc/IServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ internal interface IServer
Task<SearchOperationResult> SearchAsync(string searchTerm, bool clearCache, CancellationToken cancellationToken);
Task<ShowResult> ShowAsync(string descriptionPath, string[] includeFilters, string[] excludeFilters, bool clearCache, CancellationToken cancellationToken);
Task<ManifestResult> GetManifestDetailsAsync(string manifestPath, string apiIdentifier, bool clearCache, CancellationToken cancellationToken);
Task<List<LogEntry>> GenerateAsync(string openAPIFilePath, string outputPath, GenerationLanguage language, string[] includePatterns, string[] excludePatterns, string clientClassName, string clientNamespaceName, bool usesBackingStore, bool cleanOutput, bool clearCache, bool excludeBackwardCompatible, string[] disabledValidationRules, string[] serializers, string[] deserializers, string[] structuredMimeTypes, bool includeAdditionalData, CancellationToken cancellationToken);
Task<List<LogEntry>> GenerateAsync(string openAPIFilePath, string outputPath, GenerationLanguage language, string[] includePatterns, string[] excludePatterns, string clientClassName, string clientNamespaceName, bool usesBackingStore, bool cleanOutput, bool clearCache, bool excludeBackwardCompatible, string[] disabledValidationRules, string[] serializers, string[] deserializers, string[] structuredMimeTypes, bool includeAdditionalData, ConsumerOperation operation, CancellationToken cancellationToken);
Task<LanguagesInformation> InfoForDescriptionAsync(string descriptionPath, bool clearCache, CancellationToken cancellationToken);
Task<List<LogEntry>> GeneratePluginAsync(string openAPIFilePath, string outputPath, PluginType[] pluginTypes, string[] includePatterns, string[] excludePatterns, string clientClassName, bool cleanOutput, bool clearCache, string[] disabledValidationRules, CancellationToken cancellationToken);
Task<List<LogEntry>> GeneratePluginAsync(string openAPIFilePath, string outputPath, PluginType[] pluginTypes, string[] includePatterns, string[] excludePatterns, string clientClassName, bool cleanOutput, bool clearCache, string[] disabledValidationRules, ConsumerOperation operation, CancellationToken cancellationToken);
Task<List<LogEntry>> MigrateFromLockFileAsync(string lockDirectoryPath, CancellationToken cancellationToken);
}
36 changes: 31 additions & 5 deletions src/kiota/Rpc/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Kiota.Builder.Extensions;
using Kiota.Builder.Lock;
using Kiota.Builder.Logging;
using Kiota.Builder.WorkspaceManagement;
using Kiota.Generated;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -137,7 +138,7 @@ private static string NormalizeOperationNodePath(OpenApiUrlTreeNode node, Operat
return indexingNormalizationRegex().Replace(name, "{}");
return name;
}
public async Task<List<LogEntry>> GenerateAsync(string openAPIFilePath, string outputPath, GenerationLanguage language, string[] includePatterns, string[] excludePatterns, string clientClassName, string clientNamespaceName, bool usesBackingStore, bool cleanOutput, bool clearCache, bool excludeBackwardCompatible, string[] disabledValidationRules, string[] serializers, string[] deserializers, string[] structuredMimeTypes, bool includeAdditionalData, CancellationToken cancellationToken)
public async Task<List<LogEntry>> GenerateAsync(string openAPIFilePath, string outputPath, GenerationLanguage language, string[] includePatterns, string[] excludePatterns, string clientClassName, string clientNamespaceName, bool usesBackingStore, bool cleanOutput, bool clearCache, bool excludeBackwardCompatible, string[] disabledValidationRules, string[] serializers, string[] deserializers, string[] structuredMimeTypes, bool includeAdditionalData, ConsumerOperation operation, CancellationToken cancellationToken)
{
var logger = new ForwardedLogger<KiotaBuilder>();
var configuration = Configuration.Generation;
Expand All @@ -151,7 +152,7 @@ public async Task<List<LogEntry>> GenerateAsync(string openAPIFilePath, string o
configuration.ClearCache = clearCache;
configuration.ExcludeBackwardCompatible = excludeBackwardCompatible;
configuration.IncludeAdditionalData = includeAdditionalData;
configuration.Operation = ConsumerOperation.Add; //TODO should be updated to edit in the edit scenario
configuration.Operation = operation;
if (disabledValidationRules is { Length: > 0 })
configuration.DisabledValidationRules = disabledValidationRules.ToHashSet(StringComparer.OrdinalIgnoreCase);
if (serializers is { Length: > 0 })
Expand Down Expand Up @@ -183,7 +184,7 @@ public async Task<List<LogEntry>> GenerateAsync(string openAPIFilePath, string o
}
return logger.LogEntries;
}
public async Task<List<LogEntry>> GeneratePluginAsync(string openAPIFilePath, string outputPath, PluginType[] pluginTypes, string[] includePatterns, string[] excludePatterns, string clientClassName, bool cleanOutput, bool clearCache, string[] disabledValidationRules, CancellationToken cancellationToken)
public async Task<List<LogEntry>> GeneratePluginAsync(string openAPIFilePath, string outputPath, PluginType[] pluginTypes, string[] includePatterns, string[] excludePatterns, string clientClassName, bool cleanOutput, bool clearCache, string[] disabledValidationRules, ConsumerOperation operation, CancellationToken cancellationToken)
{
var globalLogger = new ForwardedLogger<KiotaBuilder>();
var configuration = Configuration.Generation;
Expand All @@ -194,7 +195,7 @@ public async Task<List<LogEntry>> GeneratePluginAsync(string openAPIFilePath, st
configuration.ClientClassName = clientClassName;
configuration.CleanOutput = cleanOutput;
configuration.ClearCache = clearCache;
configuration.Operation = ConsumerOperation.Add; //TODO should be updated to edit in the edit scenario
configuration.Operation = operation;
if (disabledValidationRules is { Length: > 0 })
configuration.DisabledValidationRules = disabledValidationRules.ToHashSet(StringComparer.OrdinalIgnoreCase);
if (pluginTypes is { Length: > 0 })
Expand Down Expand Up @@ -230,6 +231,28 @@ public Task<LanguagesInformation> InfoForDescriptionAsync(string descriptionPath
ArgumentException.ThrowIfNullOrEmpty(descriptionPath);
return InfoInternalAsync(descriptionPath, clearCache, cancellationToken);
}

public async Task<List<LogEntry>> MigrateFromLockFileAsync(string lockDirectoryPath, CancellationToken cancellationToken)
{
ArgumentException.ThrowIfNullOrEmpty(lockDirectoryPath);
var logger = new ForwardedLogger<KiotaBuilder>();
try
{
var workspaceManagementService = new WorkspaceManagementService(logger, httpClient, IsConfigPreviewEnabled.Value);
var clientNames = await workspaceManagementService.MigrateFromLockFileAsync(string.Empty, lockDirectoryPath, cancellationToken).ConfigureAwait(false);
if (!clientNames.Any())
{
logger.LogWarning("no client configuration was migrated");
}
logger.LogInformation("Client configurations migrated successfully: {Clients}", string.Join(", ", clientNames));
}
catch (Exception ex)
{
logger.LogCritical(ex, "error migrating the lock file: {ExceptionMessage}", ex.Message);
}
return logger.LogEntries;
}

private async Task<LanguagesInformation> InfoInternalAsync(string descriptionPath, bool clearCache, CancellationToken cancellationToken)
{
var logger = new ForwardedLogger<KiotaBuilder>();
Expand Down Expand Up @@ -257,7 +280,10 @@ private static PathItem ConvertOpenApiUrlTreeNodeToPathItem(OpenApiUrlTreeNode n
.OrderByDescending(static x => x.isOperation)
.ThenBy(static x => x.segment, StringComparer.OrdinalIgnoreCase)
.ToArray();
return new PathItem(node.Path, node.DeduplicatedSegment(), children, filteredPaths.Count == 0 || Array.Exists(children, static x => x.isOperation) && children.Where(static x => x.isOperation).All(static x => x.selected));
bool isSelected = filteredPaths.Count == 0 || // There are no filtered paths
Array.Exists(children, static x => x.isOperation) && children.Where(static x => x.isOperation).All(static x => x.selected) || // All operations have been selected
!Array.Exists(children, static x => x.isOperation) && Array.TrueForAll(children, static x => x.selected); // All paths selected but no operations present
return new PathItem(node.Path, node.DeduplicatedSegment(), children, isSelected);
}
private static string GetAbsolutePath(string source)
{
Expand Down
26 changes: 25 additions & 1 deletion vscode/microsoft-kiota/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Context: you're most likely a program manager eager to demo the latest bits from
- GitHub CLI `winget install GitHub.CLI`
- dotnet 8 `winget install Microsoft.DotNet.SDK.8`
- node 20 `winget install CoreyButler.NVMforWindows && nvm install lts && nvm use lts`
- vsce & TypeScript `npm i -g TypeScript @vscode/vsce`
- vsce & TypeScript `npm i -g typescript @vscode/vsce`

### Steps

Expand Down Expand Up @@ -46,3 +46,27 @@ Where kiotaVersionInPackage is the kiotaVersion field and versionInPackage is th
> Note: the **.vscode** segment might change to **.vscode-server** if you're remoting to WSL.

> Note: alternatively to building executable yourself, you can download it from [the pipeline](https://github.com/microsoft/kiota/actions/workflows/dotnet.yml) by filtering the branch (top right corner) with the pull request branch, selecting the latest run, and downloading the right OS version from the artifacts. The only remaining work will be to move the downloaded files to the right path above.

#### Using the ready-made script

If you want to automate these steps, you can use the following script to automate the process:

```powershell
.\scripts\execute-vscode-sideload.ps1 -Platform "win-x64|linux-x64|osx-x64"
```

If you are using WSL, you can use the following:

```powershell
.\scripts\execute-vscode-sideload.ps1 -WSL
```

## FAQ

### VS Code keeps reinstalling from the marketplace

This is most likely caused by the fact that there's a newer released version. Run the following script replacing the version argument with the latest version of kiota.

```powershell
.\scripts\update-vscode-releases.ps1 -version "versionWithoutVPrefix" -online -filePath .\vscode\microsoft-kiota\package.json
```
43 changes: 41 additions & 2 deletions vscode/microsoft-kiota/l10n/bundle.l10n.ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"Generating client...": "انشاء العميل...",
"Loading...": "جاري التحميل...",
"Updating clients...": "تحديث العملاء...",
"Pick a lock file": "اختر ملف قفل",
"Open a lock file": "افتح ملف قفل",
"Filter the API description": "قم بتصفية وصف API",
"Enter a filter": "أدخل عامل التصفية",
Expand All @@ -38,5 +37,45 @@
"Invalid URL, please check the documentation for the supported URLs": "عنوان URL غير صالح ، يرجى التحقق من الوثائق الخاصة بعناوين URL المدعومة",
"No content found in the clipboard": "لم يتم العثور على محتوى في الحافظة",
"Invalid content found in the clipboard": "تم العثور على محتوى غير صالح في الحافظة",
"Select an API manifest key": "حدد مفتاح بيان واجهة برمجة التطبيقات"
"Select an API manifest key": "حدد مفتاح بيان واجهة برمجة التطبيقات",
"Edit Paths":"",
"Re-generate": "",
"Add an API description": "",
"Search or paste a path to an API description": "",
"Generate a plugin": "",
"Generate an API manifest": "",
"What do you want to generate?": "",
"Select an option": "",
"class": "",
"namespace": "",
"output directory": "",
"language": "",
"Create a new API client": "",
"Create a new plugin": "",
"Create a new manifest": "",
"plugin name:": "",
"Choose a name for the plugin": "",
"Choose a plugin type": "",
"manifest name": "",
"Choose a name for the manifest": "",
"Required": "",
"Open installation instructions for kiota?": "",
"Invalid generation type": "",
"Yes, override it": "",
"Before adding a new API description, consider that your changes and current selection will be lost.": "",
"Cancel": "",
"Do you want to remove this API description?": "",
"Please save the workspace.json file before re-generation.": "",
"OK": "",
"Generating manifest...": "",
"Generating plugin...": "",
"Re-generating client...": "",
"Re-generating plugin...": "",
"Please migrate your API clients to Kiota workspace.":"",
"Remind me later":"",
"Migrating your API clients...":"",
"Migration completed, but no changes were detected.":"",
"Migration failed":"",
"Api clients migrated successfully!":"",
"Could not determine the workspace folder.": "لا يمكن تحديد مجلد مساحة العمل."
}
43 changes: 41 additions & 2 deletions vscode/microsoft-kiota/l10n/bundle.l10n.cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"Generating client...": "Generování klienta...",
"Updating clients...": "Aktualizace klientů...",
"Loading...": "Načítání...",
"Pick a lock file": "Vybrat soubor zámku",
"Open a lock file": "Otevřít soubor zámku",
"Filter the API description": "Filtrovat popis API",
"Enter a filter": "Zadejte filtr",
Expand All @@ -38,5 +37,45 @@
"Invalid URL, please check the documentation for the supported URLs": "Neplatná URL adresa, zkontrolujte dokumentaci pro podporované URL adresy",
"No content found in the clipboard": "V schránce nebyl nalezen žádný obsah",
"Invalid content found in the clipboard": "V schránce byl nalezen neplatný obsah",
"Select an API manifest key": "Vyberte klíč manifestu API"
"Select an API manifest key": "Vyberte klíč manifestu API",
"Edit Paths":"Upravit cesty",
"Re-generate": "Znovu vygenerovat",
"Add an API description": "Přidat popis API",
"Search or paste a path to an API description": "Hledat nebo vložit cestu k popisu API",
"Generate a plugin": "Generovat plugin",
"Generate an API manifest": "Generovat API manifest",
"What do you want to generate?": "Co chcete generovat? ",
"Select an option": "Vyberte možnost",
"class": "třída",
"namespace": "jmenný prostor",
"output directory": "výstupní adresář",
"language": "jazyk",
"Create a new API client": "Vytvořit nového API klienta",
"Create a new plugin": "Vytvořit nový plugin",
"Create a new manifest": "Vytvořit nový manifest",
"plugin name:": "název pluginu",
"Choose a name for the plugin": "Vyberte název pro plugin",
"Choose a plugin type": "Vyberte typ pluginu",
"manifest name": "název manifestu",
"Choose a name for the manifest": "Vyberte název pro manifest",
"Required": "Požadováno",
"Open installation instructions for kiota?": "Otevřít instalační pokyny pro kiota",
"Invalid generation type": "Neplatný typ generování",
"Yes, override it": "Ano, přepsat",
"Before adding a new API description, consider that your changes and current selection will be lost.": "Před přidáním nového popisu API zvažte, že vaše změny a aktuální výběr budou ztraceny.",
"Cancel": "Zrušit",
"Do you want to remove this API description?": "Chcete odstranit tento popis API?",
"Please save the workspace.json file before re-generation.": "Před generováním prosím uložte soubor workspace.json",
"OK": "OK",
"Generating manifest...": "Generování manifestu...",
"Generating plugin...": "Generování pluginu...",
"Re-generating client...": "Opětovné generování klienta...",
"Re-generating plugin...": "Opětovné generování pluginu...",
"Please migrate your API clients to Kiota workspace.":"",
"Remind me later":"",
"Migrating your API clients...":"",
"Migration completed, but no changes were detected.":"",
"Migration failed":"",
"Api clients migrated successfully!":"",
"Could not determine the workspace folder.": "Nepodařilo se určit složku pracovního prostoru."
}
43 changes: 41 additions & 2 deletions vscode/microsoft-kiota/l10n/bundle.l10n.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"Generating client...": "Generando cliente...",
"Updating clients...": "Actualizando clientes...",
"Loading...": "Cargando...",
"Pick a lock file": "Seleccionar un archivo lock",
"Open a lock file": "Abrir un archivo lock",
"Filter the API description": "Filtrar descripción de API",
"Enter a filter": "Ingresar un filtro",
Expand All @@ -38,5 +37,45 @@
"Invalid URL, please check the documentation for the supported URLs": "URL inválido, por favor revise la documentación de URL soportados.",
"No content found in the clipboard": "Sin contenido en el portapapeles.",
"Invalid content found in the clipboard": "Contenido inválido en el portapapeles.",
"Select an API manifest key": "Seleccione una llave de manifesto de API."
"Select an API manifest key": "Seleccione una llave de manifesto de API.",
"Edit Paths":"Editar ruta de acceso",
"Re-generate": "Re-generar",
"Add an API description": "Agregar una descripción de API",
"Search or paste a path to an API description": "Busca o pega una ruta a una descripcion de API",
"Generate a plugin": "Generar un plugin",
"Generate an API manifest": "Generar un manifesto de API",
"What do you want to generate?": "Qué quieres generar?",
"Select an option": "Seleccionar una opción",
"class": "clase",
"namespace": "namespace",
"output directory": "directorio de salida",
"language": "idioma",
"Create a new API client": "Crear un nuevo cliente de API",
"Create a new plugin": "Crear un nuevo plugin",
"Create a new manifest": "Crear un nuevo manifesto",
"plugin name:": "nombre del plugin",
"Choose a name for the plugin": "Elija un nombre para el plugin",
"Choose a plugin type": "Elija un tipo de plugin",
"manifest name": "Nombre de manifesto",
"Choose a name for the manifest": "Elija un nombre para el manifesto",
"Required": "Requerido",
"Open installation instructions for kiota?": "Abrir las instrucciones de instalación para Kiota",
"Invalid generation type": "Tipo de generación inválido",
"Yes, override it": "Sí, sobrescribir",
"Before adding a new API description, consider that your changes and current selection will be lost.": "Antes de agregar una nueva descripción de API, considere que sus cambios and selección actual se perderá",
"Cancel": "Cancelar",
"Do you want to remove this API description?": "Quieres quitar esta descripcion de API?",
"Please save the workspace.json file before re-generation.": "Por favor, guarde el archivo workspace.json antes de re-generar.",
"OK": "Ok",
"Generating manifest...": "Generando manifesto...",
"Generating plugin...": "Generando plugin...",
"Re-generating client...": "Re-generando cliente...",
"Re-generating plugin...": "Re-generando plugin...",
"Please migrate your API clients to Kiota workspace.":"",
"Remind me later":"",
"Migrating your API clients...":"",
"Migration completed, but no changes were detected.":"",
"Migration failed":"",
"Api clients migrated successfully!":"",
"Could not determine the workspace folder.": "No se pudo determinar la carpeta de espacio de trabajo."
}
Loading
Loading