Comments (8)
This behavior is by design. We are working (#73843) to add an option where the :warning
suffix on dotnet_style_prefer_collection_expression
is ignored in favor of using the value from dotnet_diagnostic.IDE0305.severity
, but this option will not apply to individual rules (you either get the :warning
suffix support on all supported code style rules, or you do not get it at all).
I would recommend filing a bug report specifically for the dotnet_style_prefer_collection_expression
if its current configuration is problematic.
from roslyn.
@cremor Thank you very much for taking the time to file this issue with the full detail. It would have taken me a very long time to otherwise unravel this slightly different situation from the others that have been reported recently.
I'm going to keep it in its current form so we can continue to point to it in the future as the reason why code style settings should in general apply to only one diagnostic. The new issue would focus on dotnet_style_prefer_collection_expression
specifically and its impact on multiple diagnostic IDs.
from roslyn.
@sharwell I'm not sure if I understand you correctly.
Build time analysis - which was only enabled for the :severity
suffix syntax in #52991 for .NET 9 (AnalysisLevel 9) - might not support this case. Ok, that could be a known limitation (which should be documented).
But are you saying that the current behavior of the IntelliSense analysis is by design too? Should the property EnforceCodeStyleInBuild
really influence IntelliSense analysis?
from roslyn.
@cremor I don't think I understand the question. I was reviewing this issue for the limited case where EnforceCodeStyleInBuild is set to true (step 4 in the initial post). Is there a separate question you have for a scenario where it is set to false?
from roslyn.
No, my question is about when it is set to true. But I'm observing the IntelliSense analysis results in the Visual Studio error list. I'm not concerned about build time analysis output (right now).
So while I have set EnforceCodeStyleInBuild
to true (for unrelated reasons), it shouldn't affect IntelliSense analysis results in my opinion.
from roslyn.
@sharwell (Again using a mention, not sure if you saw my last message.)
I have an additional question. What did you mean with this?
I would recommend filing a bug report specifically for the dotnet_style_prefer_collection_expression if its current configuration is problematic.
Did you only mean that in the context of build time analysis, or for IntelliSense analysis too?
from roslyn.
No, my question is about when it is set to true. But I'm observing the IntelliSense analysis results in the Visual Studio error list. I'm not concerned about build time analysis output (right now).
My answer above was related to what happens on build when EnforceCodeStyleInBuild
is true. If this value is causing a difference in the IDE or some other scenario, I would need to see a description of scenario A and the behavior in scenario A, and a description of scenario B and the behavior in scenario B. At that point we can figure out why the behavior changes.
The EnforceCodeStyleInBuild
setting should only impact IntelliSense behavior for the purpose of making the IDE behavior be the same as the compile-time behavior. Sometimes when this option is false, the IDE does things that the build would not do.
Did you only mean that in the context of build time analysis, or for IntelliSense analysis too?
I'm not aware of a case where it would make a difference here.
from roslyn.
If this value is causing a difference in the IDE or some other scenario, I would need to see a description of scenario A and the behavior in scenario A, and a description of scenario B and the behavior in scenario B. At that point we can figure out why the behavior changes.
@sharwell The description is this issue. If I understand you correctly then scenario A is step 3 and scenario B is step 5 of my first post here.
from roslyn.
Related Issues (20)
- Confusing doc comments and method names in implementation of VB's PENamespaceSymbol
- Ref safety analysis does not properly handle readonly set methods
- IDE0028 catches `ICollection<KeyValuePair<TKey, TValue>> = new Dictionary<TKey, TValue>()` as being reduceable HOT 15
- There is either a test gap, or an unnecessary attempt to lookup a local in a map in ClosureConversion
- [Automated] PRs inserted in VS build feature.debugger.main-35006.210
- Edit.Duplicate command does not insert trailing newline between original and duplicated code HOT 5
- `Remove unused using` showing up multiple times in lightbulb HOT 1
- Parameter names in target-typed new() expressions are missing among completions in compound assignment statements HOT 2
- Remove usage of IGlobalOptionService from test helpers on Features layer and below
- Proposal: Flow attributes on primary constructor parameters to generated fields HOT 8
- Please give users a choice to disable implicit usings and nullable before code is generated HOT 3
- [Automated] PRs inserted in VS build main-35007.86
- [Automated] PRs inserted in VS build main-35007.84
- Assert failure in `BindMethodBody.assertBindIdentifierTargets()` with `[param:]` attribute on local function
- Semantic snippets test flaw HOT 2
- "Invert if" does not properly enclose an entire `#region`/`#endregion`
- `allows ref struct` generic can't be tested with `is` HOT 7
- Proposal: flow attributes on parameters and type parameters to compiler-generated code HOT 11
- Autoformatting messes up indentation when starting a new line HOT 3
- Keep ref struct interfaces behind preview flag HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roslyn.