Skip to content

Commit 31769e7

Browse files
committed
- dmdserver: updated to frontend of DMD 2.107.0
- project template cache now removed if Visual D does not find itself in it.
1 parent 26b4888 commit 31769e7

File tree

11 files changed

+93
-21
lines changed

11 files changed

+93
-21
lines changed

CHANGES

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,3 +1357,13 @@ Version history
13571357
* "add imports from dependent projects" is now evaluated recursively and passed to semantic analysis
13581358
* added support for compiler option -preview=shortenedMethods
13591359
* fixed issue #264: VisualD doesn't run compiled executable, when I select "Compile and Run" option
1360+
1361+
2024-02-25 version 1.4.0-rc1
1362+
* dmdserver: updated to frontend of DMD 2.107.0
1363+
* full installer now bundled with DMD 2.107.0 and LDC 1.36.0
1364+
* mago: fix crash due to changed return values from IDiaSession in VS2022, probably fixes
1365+
issue #261
1366+
* fixed issue #269: avoid BOM in response file if system codepage is UTF-8
1367+
* project template cache now removed if Visual D does not find itself in it. Workaround for
1368+
issue #256
1369+
* fixed some version inaccuracies in installation files

c2d/pp.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class ConditionalCode
375375

376376
void convertMultipleElseIf()
377377
{
378-
assert("not implemented");
378+
assert(!"not implemented");
379379
}
380380

381381
void convertMultipleOpenElseIf()

msbuild/dbuild/CompileD.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,12 @@ protected override Encoding ResponseFileEncoding
327327
if (Compiler == "LDC")
328328
return new UTF8Encoding(false);
329329
else
330-
return System.Text.Encoding.GetEncoding(GetACP());
330+
{
331+
int cp = GetACP();
332+
if (cp == 65001)
333+
return new UTF8Encoding(false); // no BOM
334+
return System.Text.Encoding.GetEncoding(cp);
335+
}
331336
}
332337
}
333338

nsis/visuald.nsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929

3030
; define DMD source path to include dmd installation
3131
; !define DMD
32-
!define DMD_VERSION "2.106.0"
32+
!define DMD_VERSION "2.107.0"
3333
!define DMD_SRC c:\d\dmd-${DMD_VERSION}
3434

3535
; define LDC to include ldc installation
3636
; !define LDC
37-
!define LDC_VERSION "1.35.0"
37+
!define LDC_VERSION "1.36.0"
3838
!define LDC_SRC c:\d\ldc2-${LDC_VERSION}-windows-multilib
3939

4040
; define VS2019 to include VS2019 support

sdk/vsi.visualdproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,16 @@
22232223
<File path="vsi\msdbg168.d" />
22242224
<File path="vsi\msdbg169.d" />
22252225
<File path="vsi\msdbg16a.d" />
2226+
<File path="vsi\msdbg170.d" />
2227+
<File path="vsi\msdbg171.d" />
2228+
<File path="vsi\msdbg172.d" />
2229+
<File path="vsi\msdbg173.d" />
2230+
<File path="vsi\msdbg174.d" />
2231+
<File path="vsi\msdbg175.d" />
2232+
<File path="vsi\msdbg176.d" />
2233+
<File path="vsi\msdbg177.d" />
2234+
<File path="vsi\msdbg178.d" />
2235+
<File path="vsi\msdbg179.d" />
22262236
<File path="vsi\msdbg90.d" />
22272237
<File path="vsi\objext.d" />
22282238
<File path="vsi\ocdesign.d" />
@@ -2294,6 +2304,14 @@
22942304
<File path="vsi\vsshell166.d" />
22952305
<File path="vsi\vsshell167.d" />
22962306
<File path="vsi\vsshell169.d" />
2307+
<File path="vsi\vsshell171.d" />
2308+
<File path="vsi\vsshell172.d" />
2309+
<File path="vsi\vsshell174.d" />
2310+
<File path="vsi\vsshell175.d" />
2311+
<File path="vsi\vsshell176.d" />
2312+
<File path="vsi\vsshell177.d" />
2313+
<File path="vsi\vsshell178.d" />
2314+
<File path="vsi\vsshell179.d" />
22972315
<File path="vsi\vsshell2.d" />
22982316
<File path="vsi\vsshell80.d" />
22992317
<File path="vsi\vsshell90.d" />

vdc/dmdserver/dmd

Submodule dmd updated 533 files

vdc/dmdserver/dmdserver.visualdproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@
17711771
<File path="dmd\compiler\src\dmd\common\file.d" />
17721772
<File path="dmd\compiler\src\dmd\common\int128.d" />
17731773
<File path="dmd\compiler\src\dmd\common\outbuffer.d" />
1774-
<File path="dmd\compiler\src\dmd\common\string.d" />
1774+
<File path="dmd\compiler\src\dmd\common\smallbuffer.d" />
17751775
</Folder>
17761776
<Folder name="root">
17771777
<File path="dmd\compiler\src\dmd\root\aav.d" />

vdc/dmdserver/semanalysis.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void do_unittests()
422422
import dmd.hdrgen;
423423
auto buf = OutBuffer();
424424
buf.doindent = 1;
425-
moduleToBuffer(buf, mod);
425+
moduleToBuffer(buf, false, mod);
426426

427427
OutputDebugStringA(buf.peekChars);
428428
}

vdc/dmdserver/semvisitor.d

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,9 @@ TipData tipForDeclaration(Declaration decl)
11791179
auto fntype = decl.type ? decl.type.isTypeFunction() : null;
11801180

11811181
if (auto td = fntype && decl.parent ? decl.parent.isTemplateDeclaration() : null)
1182-
functionToBufferFull(fntype, buf, decl.getIdent(), &hgs, td);
1182+
functionToBufferFull(fntype, buf, decl.getIdent(), hgs, td);
11831183
else if (fntype)
1184-
functionToBufferWithIdent(fntype, buf, decl.toPrettyChars(true), &hgs, func.isStatic);
1184+
functionToBufferWithIdent(fntype, buf, decl.toPrettyChars(true), hgs, func.isStatic);
11851185
else
11861186
buf.writestring(decl.toPrettyChars(true));
11871187
auto res = buf.extractSlice(); // take ownership
@@ -2524,7 +2524,7 @@ string[] findExpansions(Module mod, int line, int index, string tok)
25242524

25252525
case EXP.dotVariable:
25262526
case EXP.dotIdentifier:
2527-
flags |= SearchLocalsOnly;
2527+
flags |= SearchOpt.localsOnly;
25282528
if (recursed)
25292529
if (auto dve = e.isDotVarExp())
25302530
if (dve.varloc.filename) // skip compiler generated idents (alias this)
@@ -2534,7 +2534,7 @@ string[] findExpansions(Module mod, int line, int index, string tok)
25342534
return getType(e1, true);
25352535

25362536
case EXP.dot:
2537-
flags |= SearchLocalsOnly;
2537+
flags |= SearchOpt.localsOnly;
25382538
return (cast(DotExp)e).e1.type;
25392539
default:
25402540
return recursed ? e.type : null;
@@ -2593,9 +2593,9 @@ string[] findExpansions(Module mod, int line, int index, string tok)
25932593
{
25942594
if (!sym)
25952595
return;
2596-
int sflags = SearchLocalsOnly;
2596+
int sflags = SearchOpt.localsOnly;
25972597
if (sym.getModule() == mod)
2598-
sflags |= IgnoreSymbolVisibility;
2598+
sflags |= SearchOpt.ignoreVisibility;
25992599
searchScope(sym, sflags);
26002600
}
26012601
// base classes
@@ -2638,14 +2638,14 @@ string[] findExpansions(Module mod, int line, int index, string tok)
26382638
}
26392639
}
26402640

2641-
if (flags & SearchLocalsOnly)
2641+
if (flags & SearchOpt.localsOnly)
26422642
break;
26432643

26442644
// imported modules
26452645
size_t cnt = sd.importedScopes ? sd.importedScopes.dim : 0;
26462646
for (size_t i = 0; i < cnt; i++)
26472647
{
2648-
if ((flags & IgnorePrivateImports) && sd.visibilities[i] == Visibility.Kind.private_)
2648+
if ((flags & SearchOpt.ignorePrivateImports) && sd.visibilities[i] == Visibility.Kind.private_)
26492649
continue;
26502650
auto ss = (*sd.importedScopes)[i].isScopeDsymbol();
26512651
if (!ss)
@@ -2654,17 +2654,17 @@ string[] findExpansions(Module mod, int line, int index, string tok)
26542654
int sflags = 0;
26552655
if (ss.isModule())
26562656
{
2657-
if (flags & SearchLocalsOnly)
2657+
if (flags & SearchOpt.localsOnly)
26582658
continue;
2659-
sflags |= IgnorePrivateImports;
2659+
sflags |= SearchOpt.ignorePrivateImports;
26602660
}
26612661
else // mixin template
26622662
{
2663-
if (flags & SearchImportsOnly)
2663+
if (flags & SearchOpt.importsOnly)
26642664
continue;
2665-
sflags |= SearchLocalsOnly;
2665+
sflags |= SearchOpt.localsOnly;
26662666
}
2667-
searchScope(ss, sflags | IgnorePrivateImports);
2667+
searchScope(ss, sflags | SearchOpt.ignorePrivateImports);
26682668
}
26692669
}
26702670
}

visuald/dpackage.d

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ version(none)
517517

518518
mOptions.initFromRegistry();
519519

520+
mOptions.checkTemplateCache();
521+
520522
// debug dumpFontsAndColors();
521523

522524
//register with ComponentManager for Idle processing
@@ -1918,6 +1920,43 @@ class GlobalOptions
19181920
baseInstallDir = "c:\\D";
19191921
}
19201922

1923+
bool checkTemplateCache()
1924+
{
1925+
bool rc = true;
1926+
try
1927+
{
1928+
if(!getRegistryRoot())
1929+
return false;
1930+
if (regUserRoot.toUpper.startsWith("SOFTWARE\\"w))
1931+
{
1932+
auto localpath = "$(LOCALAPPDATA)" ~ to!string(regUserRoot[8..$]);
1933+
localpath = replaceGlobalMacros(localpath);
1934+
if(isExistingDir(localpath))
1935+
{
1936+
string[] toRemove;
1937+
foreach (string fname; dirEntries(localpath, SpanMode.shallow))
1938+
{
1939+
if (globMatch(baseName(fname), "NpdProjectTemplateCache*"))
1940+
{
1941+
auto content = cast(ubyte[])std.file.read(fname);
1942+
if (find(content, cast(ubyte[])"\"Visual D\"").empty)
1943+
toRemove ~= fname;
1944+
}
1945+
}
1946+
foreach (string fname; toRemove)
1947+
std.file.remove(fname);
1948+
}
1949+
}
1950+
}
1951+
catch(Exception e)
1952+
{
1953+
writeToBuildOutputPane(e.msg);
1954+
rc = false;
1955+
}
1956+
1957+
return rc;
1958+
}
1959+
19211960
bool initFromRegistry(bool restoreDefaults = false)
19221961
{
19231962
bool rc = true;

0 commit comments

Comments
 (0)