Skip to content

Commit 904751f

Browse files
committed
Merge pull request #709 from mjbvz/cs-line-ending-normalization
Normalize line endings to CR LF in *.cs files
2 parents 20e73a9 + bd2dd57 commit 904751f

179 files changed

Lines changed: 30698 additions & 30693 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# Do not normalize line endings from CR LF to LF, regardless of core.autocrlf.
2-
* -text
2+
* -text
3+
4+
# Normalize C# source files to use CR LF line endings.
5+
*.cs text eol=crlf
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
//*********************************************************//
2-
// Copyright (c) Microsoft. All rights reserved.
3-
//
4-
// Apache 2.0 License
5-
//
6-
// You may obtain a copy of the License at
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12-
// implied. See the License for the specific language governing
13-
// permissions and limitations under the License.
14-
//
15-
//*********************************************************//
16-
17-
namespace Microsoft.NodejsTools.Telemetry {
18-
/// <summary>
19-
/// Telemetry event names
20-
/// </summary>
21-
internal static class TelemetryEvents {
22-
public const string ProjectImported = "ProjectImported";
23-
}
24-
}
1+
//*********************************************************//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Apache 2.0 License
5+
//
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12+
// implied. See the License for the specific language governing
13+
// permissions and limitations under the License.
14+
//
15+
//*********************************************************//
16+
17+
namespace Microsoft.NodejsTools.Telemetry {
18+
/// <summary>
19+
/// Telemetry event names
20+
/// </summary>
21+
internal static class TelemetryEvents {
22+
public const string ProjectImported = "ProjectImported";
23+
}
24+
}
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
//*********************************************************//
2-
// Copyright (c) Microsoft. All rights reserved.
3-
//
4-
// Apache 2.0 License
5-
//
6-
// You may obtain a copy of the License at
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12-
// implied. See the License for the specific language governing
13-
// permissions and limitations under the License.
14-
//
15-
//*********************************************************//
16-
17-
namespace Microsoft.NodejsTools.Telemetry {
18-
/// <summary>
19-
/// Property names for telemetry events
20-
/// </summary>
21-
internal static class TelemetryProperties {
22-
public const string ProjectGuid = "ProjectGuid";
23-
}
24-
}
1+
//*********************************************************//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Apache 2.0 License
5+
//
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12+
// implied. See the License for the specific language governing
13+
// permissions and limitations under the License.
14+
//
15+
//*********************************************************//
16+
17+
namespace Microsoft.NodejsTools.Telemetry {
18+
/// <summary>
19+
/// Property names for telemetry events
20+
/// </summary>
21+
internal static class TelemetryProperties {
22+
public const string ProjectGuid = "ProjectGuid";
23+
}
24+
}

Nodejs/NodejsTools.sln.DotSettings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@
1717
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">250</s:Int64>
1818
<s:String x:Key="/Default/CodeStyle/CodeFormatting/XmlDocFormatter/IndentSubtags/@EntryValue">ZeroIndent</s:String>
1919
<s:String x:Key="/Default/CodeStyle/CodeFormatting/XmlDocFormatter/IndentTagContent/@EntryValue">ZeroIndent</s:String>
20-
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
20+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
21+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
22+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Nodejs/Product/Analysis/Analysis/AnalysisLimits.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public static AnalysisLimits MakeLowAnalysisLimits() {
148148
/// <summary>
149149
/// Gets the maximum number of types which can be merged at once.
150150
/// </summary>
151-
public int MaxMergeTypes { get; set; }
152-
151+
public int MaxMergeTypes { get; set; }
152+
153153
/// <summary>
154154
/// Gets the maximum number of events which can be emitted at once.
155155
/// </summary>
@@ -165,7 +165,7 @@ public static AnalysisLimits MakeLowAnalysisLimits() {
165165
/// </summary>
166166
/// <param name="nestedModulesDepth">Depth of module file which has to be checked for depth limit.</param>
167167
/// <returns>True if path too deep in nesting tree; false overwise.</returns>
168-
public bool IsPathExceedNestingLimit(int nestedModulesDepth) {
168+
public bool IsPathExceedNestingLimit(int nestedModulesDepth) {
169169
return nestedModulesDepth > NestedModulesLimit;
170170
}
171171

Nodejs/Product/Analysis/Analysis/Analyzer/AnalysisUnit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ internal void Analyze(DDG ddg, CancellationToken cancel) {
183183
long endTime = _sw.ElapsedMilliseconds;
184184
var thisTime = endTime - startTime;
185185
_analysisTime += thisTime;
186-
if (thisTime >= 500 || (_analysisTime / _analysisCount) > 500) {
186+
if (thisTime >= 500 || (_analysisTime / _analysisCount) > 500) {
187187
Trace.TraceWarning("Analyzed: {0} {1} ({2} count, {3}ms total, {4}ms mean)", this, thisTime, _analysisCount, _analysisTime, (double)_analysisTime / _analysisCount);
188188
}
189189
}
Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
//*********************************************************//
2-
// Copyright (c) Microsoft. All rights reserved.
3-
//
4-
// Apache 2.0 License
5-
//
6-
// You may obtain a copy of the License at
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12-
// implied. See the License for the specific language governing
13-
// permissions and limitations under the License.
14-
//
15-
//*********************************************************//
16-
17-
using System.Diagnostics;
18-
using System.Threading;
19-
20-
namespace Microsoft.NodejsTools.Analysis.Analyzer {
21-
class RequireAnalysisUnit : AnalysisUnit {
22-
private string _dependency;
23-
private ModuleTree _tree;
24-
private ModuleTable _table;
25-
26-
internal RequireAnalysisUnit(ModuleTree tree, ModuleTable table, ProjectEntry entry, string dependency) : base (entry.Tree, entry.EnvironmentRecord) {
27-
_tree = tree;
28-
_table = table;
29-
_dependency = dependency;
30-
}
31-
32-
internal override void AnalyzeWorker(DDG ddg, CancellationToken cancel) {
33-
ModuleTree module = _table.RequireModule(this, _dependency, _tree);
34-
if (module == null) {
35-
return;
36-
}
37-
38-
AddChildVisibilitiesExcludingNodeModules(module);
39-
}
40-
41-
private void AddChildVisibilitiesExcludingNodeModules(ModuleTree moduleTree) {
1+
//*********************************************************//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Apache 2.0 License
5+
//
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12+
// implied. See the License for the specific language governing
13+
// permissions and limitations under the License.
14+
//
15+
//*********************************************************//
16+
17+
using System.Diagnostics;
18+
using System.Threading;
19+
20+
namespace Microsoft.NodejsTools.Analysis.Analyzer {
21+
class RequireAnalysisUnit : AnalysisUnit {
22+
private string _dependency;
23+
private ModuleTree _tree;
24+
private ModuleTable _table;
25+
26+
internal RequireAnalysisUnit(ModuleTree tree, ModuleTable table, ProjectEntry entry, string dependency) : base (entry.Tree, entry.EnvironmentRecord) {
27+
_tree = tree;
28+
_table = table;
29+
_dependency = dependency;
30+
}
31+
32+
internal override void AnalyzeWorker(DDG ddg, CancellationToken cancel) {
33+
ModuleTree module = _table.RequireModule(this, _dependency, _tree);
34+
if (module == null) {
35+
return;
36+
}
37+
38+
AddChildVisibilitiesExcludingNodeModules(module);
39+
}
40+
41+
private void AddChildVisibilitiesExcludingNodeModules(ModuleTree moduleTree) {
4242
foreach (var childTree in moduleTree.GetChildrenExcludingNodeModules()) {
4343
Debug.Assert(childTree.Name != AnalysisConstants.NodeModulesFolder);
4444
if (childTree.ProjectEntry == null) {
4545
AddChildVisibilitiesExcludingNodeModules(childTree);
4646
} else {
4747
_table.AddVisibility(_tree, childTree.ProjectEntry);
4848
}
49-
}
50-
}
51-
}
49+
}
50+
}
51+
}
5252
}

Nodejs/Product/Analysis/Analysis/GlobalBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,9 +1342,9 @@ private static IAnalysisSet DefineProperties(FunctionValue func, Node node, Anal
13421342
}
13431343

13441344
private static IAnalysisSet Require(FunctionValue func, Node node, AnalysisUnit unit, IAnalysisSet @this, IAnalysisSet[] args) {
1345-
IAnalysisSet res = AnalysisSet.Empty;
1346-
1347-
if (node.GetType() != typeof(CallNode)) {
1345+
IAnalysisSet res = AnalysisSet.Empty;
1346+
1347+
if (node.GetType() != typeof(CallNode)) {
13481348
return res;
13491349
}
13501350

Nodejs/Product/Analysis/Analysis/JsAnalyzer.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public IAnalyzable AddPackageJson(string filePath, string entryPoint, List<strin
141141

142142
var tree = Modules.GetModuleTree(Path.GetDirectoryName(filePath));
143143

144-
tree.DefaultPackage = entryPoint;
145-
144+
tree.DefaultPackage = entryPoint;
145+
146146
ProjectEntry projectEntry = null;
147147
if (dependencies != null) {
148148
projectEntry = new ProjectEntry(this, filePath, null);
@@ -175,17 +175,17 @@ public void Analyze(CancellationToken cancel) {
175175
_tree.EnqueueDependents();
176176
}
177177

178-
if (_dependencies != null) {
179-
var requireAnalysisUnits = new List<RequireAnalysisUnit>();
180-
requireAnalysisUnits.AddRange(_dependencies.Select(
181-
dependency => {
182-
return new RequireAnalysisUnit(_tree, _modules, _projectEntry, dependency);
183-
}));
184-
185-
foreach (var unit in requireAnalysisUnits) {
186-
unit.AnalyzeWorker(null, cancel);
187-
}
188-
}
178+
if (_dependencies != null) {
179+
var requireAnalysisUnits = new List<RequireAnalysisUnit>();
180+
requireAnalysisUnits.AddRange(_dependencies.Select(
181+
dependency => {
182+
return new RequireAnalysisUnit(_tree, _modules, _projectEntry, dependency);
183+
}));
184+
185+
foreach (var unit in requireAnalysisUnits) {
186+
unit.AnalyzeWorker(null, cancel);
187+
}
188+
}
189189
}
190190
}
191191

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
//*********************************************************//
2-
// Copyright (c) Microsoft. All rights reserved.
3-
//
4-
// Apache 2.0 License
5-
//
6-
// You may obtain a copy of the License at
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12-
// implied. See the License for the specific language governing
13-
// permissions and limitations under the License.
14-
//
15-
//*********************************************************//
16-
17-
using System;
18-
using System.Collections.Generic;
19-
using System.Linq;
20-
21-
namespace Microsoft.NodejsTools.Analysis {
22-
internal static class ModuleTreeExtensions {
23-
internal static IEnumerable<ModuleTree> GetChildrenExcludingNodeModules(this ModuleTree moduleTree) {
24-
if (moduleTree == null) {
25-
return Enumerable.Empty<ModuleTree>();
26-
}
27-
// Children.Values returns an IEnumerable
28-
// The process of resolving modules can lead us to add entries into the underlying array
29-
// doing so results in exceptions b/c the array has changed under the enumerable
30-
// To avoid this, we call .ToArray() to create a copy of the array locally which we then Enumerate
31-
return moduleTree.Children.Values.ToArray().Where(mod => mod != null && !String.Equals(mod.Name, AnalysisConstants.NodeModulesFolder, StringComparison.OrdinalIgnoreCase));
32-
}
33-
}
34-
}
1+
//*********************************************************//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Apache 2.0 License
5+
//
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12+
// implied. See the License for the specific language governing
13+
// permissions and limitations under the License.
14+
//
15+
//*********************************************************//
16+
17+
using System;
18+
using System.Collections.Generic;
19+
using System.Linq;
20+
21+
namespace Microsoft.NodejsTools.Analysis {
22+
internal static class ModuleTreeExtensions {
23+
internal static IEnumerable<ModuleTree> GetChildrenExcludingNodeModules(this ModuleTree moduleTree) {
24+
if (moduleTree == null) {
25+
return Enumerable.Empty<ModuleTree>();
26+
}
27+
// Children.Values returns an IEnumerable
28+
// The process of resolving modules can lead us to add entries into the underlying array
29+
// doing so results in exceptions b/c the array has changed under the enumerable
30+
// To avoid this, we call .ToArray() to create a copy of the array locally which we then Enumerate
31+
return moduleTree.Children.Values.ToArray().Where(mod => mod != null && !String.Equals(mod.Name, AnalysisConstants.NodeModulesFolder, StringComparison.OrdinalIgnoreCase));
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)