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

Improve Visual Studio Code support #2015

Merged
merged 8 commits into from
Apr 28, 2021

Conversation

pellared
Copy link
Member

@pellared pellared commented Apr 27, 2021

Why

Make it easier (or even possible) to develop OTel .NET using VS Code. Right now if you try to use VS Code you would get tons of errors. Moreover, for me, Intellisense was not even working.

Changes

  • Fixes in .csproj to reduce the number of "problems". For me, it reduced the number of problems from ~400 to ~100. It was discussed on Slack here. Most of the ones that left are ASP.NET related which is not worth fixing - it would probably require a dedicated .sln for non-Windows dev environments. Unfortunately, AFAIK the C# extension does not support *.proj files.
  • Add .vscode and .devcontainer to .gitignore in case someone wants to use different settings

Testing

I was testing everything in Development Container (on Windows) that is created in this PR.

It would be great if someone double-checks if this PR does not break anything for Visual Studio. Low probability, but worth ensuring.

@pellared pellared requested a review from a team April 27, 2021 10:40
@codecov
Copy link

codecov bot commented Apr 27, 2021

Codecov Report

Merging #2015 (d715d33) into main (58a8d1b) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2015      +/-   ##
==========================================
+ Coverage   83.86%   83.87%   +0.01%     
==========================================
  Files         192      192              
  Lines        6184     6184              
==========================================
+ Hits         5186     5187       +1     
+ Misses        998      997       -1     
Impacted Files Coverage Δ
...ZPages/Implementation/ZPagesExporterEventSource.cs 56.25% <0.00%> (-6.25%) ⬇️
...ter.ZPages/Implementation/ZPagesActivityTracker.cs 97.14% <0.00%> (-2.86%) ⬇️
...emetry.Api/Internal/OpenTelemetryApiEventSource.cs 82.35% <0.00%> (+8.82%) ⬆️

@pellared pellared closed this Apr 27, 2021
@pellared pellared reopened this Apr 27, 2021
@pellared pellared changed the title Refine Visual Studio Code support Improve Visual Studio Code support Apr 27, 2021
@bruno-garcia
Copy link
Member

bruno-garcia commented Apr 27, 2021

are all the 'example' stuff for developing in a container required?

@pellared
Copy link
Member Author

pellared commented Apr 27, 2021

are all the 'example' stuff for developing in a container required?

No. Can you elaborate if you have any concerns?

Nothing here is required. It is intended to help others contribute. 😉

@bruno-garcia
Copy link
Member

No major concerns. Just minors:

  • Could live on another repo and we simply link to it from CONTRIBUTING.md
  • Not something that is part of CI so can likely break and go undetected

@pellared
Copy link
Member Author

pellared commented Apr 28, 2021

@bruno-garcia @reyang
Do you prefer to get rid of .vscode.example and .devcontainer.example from this PR?
We can always add it in future.
The csproj changes and .gitignore update are more important😉

@reyang
Copy link
Member

reyang commented Apr 28, 2021

@bruno-garcia @reyang
Do you prefer to get rid of .vscode.example and .devcontainer.example from this PR?
We can always add it in future.
The csproj changes and .gitignore update are more important😉

Yes I prefer not having any IDE/editor specific files unless there is a way to keep them up-to-date.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM.

@pellared
Copy link
Member Author

pellared commented Apr 28, 2021

@reyang @bruno-garcia I removed the IDE/editor-specific files. 3250153

@reyang reyang added infra Infra work - CI/CD, code coverage, linters pr:please-merge labels Apr 28, 2021
@pellared pellared closed this Apr 28, 2021
@pellared pellared reopened this Apr 28, 2021
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the change only for ordering? Does VSCode enforce the ordering of TargetFrameworks if so?

Copy link
Member Author

Choose a reason for hiding this comment

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

@cijothomas cijothomas merged commit 50b0148 into open-telemetry:main Apr 28, 2021
@pellared pellared deleted the refine-vscode-support branch April 28, 2021 18:09
tillig added a commit to tillig/opentelemetry-dotnet that referenced this pull request Mar 9, 2022
PR open-telemetry#2015 fixed the target framework ordering to allow better VS Code
due to the challenges with VS Code multi-targeting:
dotnet/vscode-csharp#1783
dotnet/vscode-csharp#3754

Short version: VS Code support is better if you list the latest .NET
Core frameworks first. Recent projects and updates have lost that
ordering so VS Code isn't great on non-Windows. This restores that
order and updates the latest projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Infra work - CI/CD, code coverage, linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants