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

Feature: Update kiota vs code extension #4500

Merged
merged 211 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 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
8f5f368
Feat: Add migration dialog (#5144)
ElinorW Aug 15, 2024
b9881af
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 15, 2024
f47a10f
chore: adds missing french translations
baywet Aug 15, 2024
51f4866
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 16, 2024
502ca35
add missing translations
ElinorW Aug 19, 2024
a896c99
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW Aug 19, 2024
db54676
simpify function
ElinorW Aug 19, 2024
80c9fde
rename function
ElinorW Aug 19, 2024
4705d68
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 19, 2024
5eb1083
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 19, 2024
04725b6
fix: bumps vscode extension version to allow side-loading
baywet Aug 19, 2024
55f5c44
update message display
ElinorW Aug 19, 2024
e04a4d5
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW Aug 19, 2024
99cf661
use workspace instead of lock
ElinorW Aug 20, 2024
8da95e9
use workspaceFile instead
ElinorW Aug 20, 2024
1f0d881
format file
ElinorW Aug 20, 2024
25b3944
Merge branch 'main' into elinor/add-kiota-workspace
ElinorW Aug 20, 2024
619b658
add missing translations
ElinorW Aug 20, 2024
1a1620c
Merge branch 'elinor/add-kiota-workspace' of https://github.com/micro…
ElinorW Aug 20, 2024
3e62e15
update function name
ElinorW Aug 20, 2024
8c9f084
format file
ElinorW Aug 20, 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 @@
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);

Check warning on line 13 in src/kiota/Rpc/IServer.cs

View workflow job for this annotation

GitHub Actions / Build

Method has 18 parameters, which is greater than the 7 authorized. (https://rules.sonarsource.com/csharp/RSPEC-107)
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);

Check warning on line 15 in src/kiota/Rpc/IServer.cs

View workflow job for this annotation

GitHub Actions / Build

Method has 11 parameters, which is greater than the 7 authorized. (https://rules.sonarsource.com/csharp/RSPEC-107)
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 @@ -68,12 +69,12 @@
_ = await Task.WhenAll(configurations
.Select(x => GenerateClientAsync(x, logger, cancellationToken)));
foreach (var (lockInfo, lockDirectoryPath) in locks)
logger.LogInformation("Update of {clientClassName} client for {language} at {lockDirectoryPath} completed", lockInfo?.ClientClassName, lockInfo?.Language, lockDirectoryPath);

Check warning on line 72 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
logger.LogInformation("Update of {length} clients completed successfully", locks.Length);

Check warning on line 73 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
}
catch (Exception ex)
{
logger.LogCritical("error updating the client: {exceptionMessage}", ex.Message);

Check warning on line 77 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Logging in a catch clause should pass the caught exception as a parameter. (https://rules.sonarsource.com/csharp/RSPEC-6667)

Check warning on line 77 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
}
return logger.LogEntries;
}
Expand Down Expand Up @@ -137,7 +138,7 @@
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 @@
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 All @@ -173,17 +174,17 @@
{
var result = await GenerateClientAsync(configuration, logger, cancellationToken);
if (result)
logger.LogInformation("Generation of {clientClassName} client for {language} at {outputPath} completed", configuration.ClientClassName, configuration.Language, configuration.OutputPath);

Check warning on line 177 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
else
logger.LogInformation("Client generation skipped, client is up to date");
}
catch (Exception ex)
{
logger.LogCritical("error generating the client: {exceptionMessage}", ex.Message);

Check warning on line 183 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Logging in a catch clause should pass the caught exception as a parameter. (https://rules.sonarsource.com/csharp/RSPEC-6667)

Check warning on line 183 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
}
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 @@
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 All @@ -217,7 +218,7 @@
}
catch (Exception ex)
{
globalLogger.LogCritical(ex, "error adding the client: {exceptionMessage}", ex.Message);

Check warning on line 221 in src/kiota/Rpc/Server.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
}
return globalLogger.LogEntries;
}
Expand All @@ -230,6 +231,28 @@
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 @@
.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": "إضافة وصف API",
"Search or paste a path to an API description": "ابحث أو الصق مسارًا إلى وصف API",
"Generate a plugin": "إنشاء البرنامج المساعد",
"Generate an API manifest": "إنشاء بيان API",
"What do you want to generate?" : "ماذا تريد أن تولد؟",
"Select an option": " حدد خيارًا",
"class": "فئة",
"namespace": "مساحة الاسم",
"output directory": "مجلد الإخراج",
"language": "لغة",
"Create a new API client": "إنشاء عميل API جديد",
"Create a new plugin": "إنشاء مكون إضافي جديد",
"Create a new manifest": "إنشاء بيان API جديد",
"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?": "هل تريد فتح تعليمات التثبيت لـ 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?": "هل تريد إزالة وصف API هذا؟",
"Please save the workspace.json file before re-generation.": "يرجى حفظ ملف workspace.json قبل إعادة الإنشاء.",
"OK": "حسنا",
"Generating manifest...": "جارٍ إنشاء البيان...",
"Generating plugin...": "جارٍ إنشاء البرنامج المساعد...",
"Re-generating client...": "إعادة إنشاء العميل...",
"Re-generating plugin...": "إعادة إنشاء البرنامج المساعد...",
"Please migrate your API clients to Kiota workspace.":"يرجى ترحيل عملاء API الخاصين بك إلى مساحة العمل Kiota.",
"Remind me later":"ذكرني لاحقًا",
"Migrating your API clients...": "جاري ترحيل عملاء API الخاصين بك...",
"Migration completed, but no changes were detected.": "تم الانتهاء من الترحيل، ولكن لم يتم اكتشاف أي تغييرات.",
"Migration failed":"فشل الترحيل",
"API clients migrated successfully!":"تم ترحيل عملاء API بنجاح!",
"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.":"Prosím, přesuňte své klienty API do pracovního prostoru Kiota.",
"Remind me later":"Připomeňte mi to později",
"Migrating your API clients...":"Přesouvání vašich klientů API…",
"Migration completed, but no changes were detected.":"Migrace dokončena, ale nebyly zjištěny žádné změny.",
"Migration failed":"Migrace selhala.",
"API clients migrated successfully!":"Klienti API byli úspěšně přesunuti!",
"Could not determine the workspace folder.": "Nepodařilo se určit složku pracovního prostoru."
}
Loading
Loading