Skip to content

Commit a5420e7

Browse files
author
Denis Peshkov
committed
Merge branch 'master' into feature/3_Dynamic_build_module_name_from_server_dto's_namespace
2 parents 4c4776d + ab45eea commit a5420e7

6 files changed

Lines changed: 12 additions & 10 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ x64/
2121
*.ncrunchsolution
2222
*.ncrunchproject
2323
_NCrunch_WebCompiler
24-
*.d.ts
24+
*.generated.d.ts
25+
*.generated.ts

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2016 Mads Kristensen
1+
Copyright 2018 Denis Peshkov
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -10,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
1010
distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
13-
limitations under the License.
13+
limitations under the License.

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for:
2222
install:
2323
- ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/denis-peshkov/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex
2424
before_build:
25-
- ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion
25+
- ps: Vsix-IncrementVsixVersion -initialVersion 2.1.0.0 -updateVsixCsVersion | Vsix-UpdateBuildVersion
2626
after_test:
2727
- ps: Vsix-PushArtifacts | Vsix-PublishToGallery
2828

src/TypeScriptDefinitionGenerator/Generator/IntellisenseParser.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ private static IntellisenseType GetType(CodeClass rootElement, CodeTypeRef codeT
297297

298298
//VSHelpers.WriteOnBuildDebugWindow($"#{result.CodeName}#{result.TypeScriptName}#{effectiveTypeRef.AsString}#{effectiveTypeRef.AsFullName}#{effectiveTypeRef.CodeType}");
299299
//VSHelpers.WriteOnBuildDebugWindow($"##{effectiveTypeRef.TypeKind}##{vsCMTypeRef.vsCMTypeRefCodeType}##{effectiveTypeRef.CodeType.InfoLocation}##{vsCMInfoLocation.vsCMInfoLocationProject}");
300+
301+
result.ClientSideReferenceName = null;
300302
if (effectiveTypeRef.TypeKind == vsCMTypeRef.vsCMTypeRefCodeType)
301303
{
302304
var hasIntellisense = Options.IgnoreIntellisense;
@@ -308,10 +310,9 @@ private static IntellisenseType GetType(CodeClass rootElement, CodeTypeRef codeT
308310
hasIntellisense = HasIntellisense(codeEnum.ProjectItem, references);
309311
}
310312

311-
result.ClientSideReferenceName = (codeClass != null && hasIntellisense ? (GetNamespace(codeClass) + "." + Utility.CamelCaseClassName(GetClassName(codeClass))) : null) ??
312-
(codeEnum != null && hasIntellisense ? (GetNamespace(codeEnum) + "." + Utility.CamelCaseClassName(codeEnum.Name)) : null);
313+
result.ClientSideReferenceName = (codeClass != null && hasIntellisense ? (Options.DeclareModule ? GetNamespace(codeClass) + "." : "") + Utility.CamelCaseClassName(GetClassName(codeClass)) : null) ??
314+
(codeEnum != null && hasIntellisense ? (Options.DeclareModule ? GetNamespace(codeEnum) + "." : "") + Utility.CamelCaseClassName(codeEnum.Name) : null);
313315
}
314-
else result.ClientSideReferenceName = null;
315316

316317
if (!isPrimitive && (codeClass != null || codeEnum != null) && !traversedTypes.Contains(effectiveTypeRef.CodeType.FullName) && !isCollection)
317318
{

tests/ClassLibrary1/ClassLibrary1.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<None Update="Some.generated.d.ts">
8+
<None Update="Some.generated.ts">
99
<DependentUpon>Some.cs</DependentUpon>
1010
</None>
11-
<None Update="SomeClass.generated.d.ts">
11+
<None Update="SomeClass.generated.ts">
1212
<DependentUpon>SomeClass.cs</DependentUpon>
1313
</None>
1414
<None Update="SomeSomeClass.generated.d.ts">

tests/TypeScriptDefinitionGenerator.Tests/TypeScriptDefinitionGenerator.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<None Update="Class1.cs.generated.d.ts">
4141
<DependentUpon>Class1.cs</DependentUpon>
4242
</None>
43-
<None Update="Class1.generated.d.ts">
43+
<None Update="Class1.generated.ts">
4444
<DependentUpon>Class1.cs</DependentUpon>
4545
</None>
4646
</ItemGroup>

0 commit comments

Comments
 (0)