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

[vs code extension] improving messages in the terminal #6622

Closed
josefree opened this issue Mar 24, 2025 · 3 comments
Closed

[vs code extension] improving messages in the terminal #6622

josefree opened this issue Mar 24, 2025 · 3 comments
Assignees
Labels
ide Issues for VS, VSCode, Monaco, etc.

Comments

@josefree
Copy link
Member

When .NET client library generation failed because of missing .NET SDK. The messages of root cause were printed as "[info]" (highlight in bold below) with verbose diagnostics. Suggest inprovements:

  1. the root cause error should be [error]
  2. the diagnostics should be folded into trace file, instead of printing in the terminal.

===================================

2025-03-24 13:07:44.625 [info] error @typespec/http-client-csharp/invalid-dotnet-sdk-dependency: The dotnet command was not found in the PATH. Please install the .NET SDK version 8 or above. Guidance for installing the .NET SDK can be found at https://dotnet.microsoft.com/.
2025-03-24 13:07:44.626 [info] Found 1 error, 8 warnings.
2025-03-24 13:07:44.651 [error] Emitting client code for .NET...Failed. TypeSpec compiler v0.67.1

Diagnostics were reported during compilation:

../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:190:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.Pets.update.
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:270:5 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:294:11 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:69:24 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:398:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.PetCheckups.createOrUpdate.
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:72:11 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:340:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.PetInsurance.update.
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:357:5 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:75:32 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:340:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.ToyInsurance.update.
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:357:5 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:86:32 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:135:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.Checkups.createOrUpdate.
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:89:11 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:190:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.Owners.update.
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:270:5 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:294:11 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:92:26 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:398:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.OwnerCheckups.createOrUpdate.
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:95:11 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:340:3 - warning @typespec/http-client-csharp/unsupported-patch-convenience-method: Convenience method is not supported for PATCH method, it will be turned off. Please set the '@convenientAPI' to false for operation TypeSpec.Rest.Resource.OwnerInsurance.update.
../xxxx/typespec-e2e-demo/petstore/spec/node_modules/@typespec/rest/lib/resource.tsp:357:5 - occurred while instantiating template
../xxxx/typespec-e2e-demo/petstore/spec/main.tsp:98:34 - occurred while instantiating template
error @typespec/http-client-csharp/invalid-dotnet-sdk-dependency: The dotnet command was not found in the PATH. Please install the .NET SDK version 8 or above. Guidance for installing the .NET SDK can be found at https://dotnet.microsoft.com/.

Found 1 error, 8 warnings.

  • Compiling...
    ✔ Compiling
  • Running @typespec/http-client-csharp...
    × @typespec/http-client-csharp ../outputs/clients/dotnet/
    node C:\Users\yiqiu\GitHub\typespec-e2e-demo\petstore\spec\node_modules@typespec\compiler\cmd\tsp.js compile xxxx/typespec-e2e-demo/petstore/spec/main.tsp --emit @typespec/http-client-csharp --pretty false failed with exit code 1
@josefree josefree added the ide Issues for VS, VSCode, Monaco, etc. label Mar 24, 2025
@chunyu3 chunyu3 self-assigned this Mar 24, 2025
@chunyu3
Copy link
Contributor

chunyu3 commented Mar 24, 2025

TypeSpec compiler will send diagnostic (warning and error) to stdout. Now we don't have an easy way to distinguish out diagnostic from other output, so we log them as info for all logs from stdout.
and cannot distinguish out error diagnostic and warning diagnostic, either.

We will discuss with typespec/compiler to give out rules about those logs (which sent to stdout, which sent to stderr, how to identify error or warning diagnostic, and so on), so that Vscode extension can correct route those logs.

@josefree josefree changed the title [vs code extension] improving [vs code extension] improving messages in the terminal Mar 24, 2025
@RodgeFu
Copy link
Contributor

RodgeFu commented Mar 24, 2025

We are having much trouble using the Output window for showing the output from compiler. I think we can try to use vscode task or terminal instead to resolve all the problem there. @chunyu3 , could you help to do some investigation there? thanks.

@RodgeFu
Copy link
Contributor

RodgeFu commented Mar 29, 2025

let's track the effort using #6663 . close a dup.

@RodgeFu RodgeFu closed this as completed Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

No branches or pull requests

3 participants