@@ -41,8 +41,8 @@ class DCDComponent : ComponentWrapper
4141 installedVersion = workspaced.globalConfiguration.get (" dcd" , " _installedVersion" , " " );
4242
4343 if (installedVersion.length
44- && this .clientPath == workspaced.globalConfiguration.get (" dcd" , " _clientPath" , " " )
45- && this .serverPath == workspaced.globalConfiguration.get (" dcd" , " _serverPath" , " " ))
44+ && this .clientPath == workspaced.globalConfiguration.get (" dcd" , " _clientPath" , " " )
45+ && this .serverPath == workspaced.globalConfiguration.get (" dcd" , " _serverPath" , " " ))
4646 {
4747 if (workspaced.globalConfiguration.get (" dcd" , " _usingInternal" , false ))
4848 client = new BuiltinDCDClient();
@@ -68,7 +68,8 @@ class DCDComponent : ComponentWrapper
6868 trace(" Detected dcd-server " , serverPathInfo, installedVersion);
6969
7070 if (! checkVersion(installedVersion, BuiltinDCDClient.minSupportedServerInclusive)
71- || checkVersion(installedVersion, BuiltinDCDClient.maxSupportedServerExclusive))
71+ || checkVersion(installedVersion, BuiltinDCDClient
72+ .maxSupportedServerExclusive))
7273 {
7374 trace(" Using dcd-client instead of internal workspace-d client" );
7475
@@ -93,19 +94,20 @@ class DCDComponent : ComponentWrapper
9394 assert (this .clientPath == clientPath);
9495 assert (this .serverPath == serverPath);
9596
96- // dfmt off
9797 if (isOutdated)
9898 workspaced.messageHandler.warn(refInstance, " dcd" ,
9999 WarningId.dcdOutdated, " DCD is outdated" );
100- // dfmt on
101100
102101 workspaced.globalConfiguration.set(" dcd" , " _usingInternal" ,
103- cast (ExternalDCDClient) client ? false : true );
102+ cast (ExternalDCDClient) client ? false : true );
104103 workspaced.globalConfiguration.set(" dcd" , " _clientPath" , clientPath);
105104 workspaced.globalConfiguration.set(" dcd" , " _serverPath" , serverPath);
106105 workspaced.globalConfiguration.set(" dcd" , " _installedVersion" , installedVersion);
107106 }
108107
108+ // using both static and __gshared because it didn't work without both for me, but I couldn't isolate it
109+ static __gshared bool ignoreOutdatedThisSession = false ; // @suppress(dscanner.unnecessary.duplicate_attribute)
110+
109111 // / Returns: true if DCD version is less than latestKnownVersion or if server and client mismatch or if it doesn't exist.
110112 bool isOutdated ()
111113 {
@@ -123,19 +125,28 @@ class DCDComponent : ComponentWrapper
123125 }
124126 }
125127
128+ if (ignoreOutdatedThisSession)
129+ return false ;
130+
126131 if (installedVersion.isLocallyCompiledDCD)
127132 return false ;
128133
129134 return ! checkVersion(installedVersion, latestKnownVersion);
130135 }
131136
137+ // / During the runtime of this serve-d run, ignore DCD outdated warnings.
138+ void ignoreOutdatedForSession ()
139+ {
140+ ignoreOutdatedThisSession = true ;
141+ }
142+
132143 // / Returns: The current detected installed version of dcd-client.
133144 // / Ends with `"-workspaced-builtin"` if this is using the builtin
134145 // / client.
135146 string clientInstalledVersion () @property const
136147 {
137- return cast (ExternalDCDClient) client ? installedVersion :
138- BuiltinDCDClient.clientVersion ~ " -workspaced-builtin" ;
148+ return cast (ExternalDCDClient) client ? installedVersion
149+ : BuiltinDCDClient.clientVersion ~ " -workspaced-builtin" ;
139150 }
140151
141152 // / Returns: The current detected installed version of dcd-server. `null` if
@@ -208,7 +219,8 @@ class DCDComponent : ComponentWrapper
208219
209220 client.runningPort = port;
210221 client.socketFile = buildPath(tempDir,
211- " workspace-d-sock" ~ thisProcessID.to! string ~ " -" ~ uniform! ulong .to! string (36 ));
222+ " workspace-d-sock" ~ thisProcessID.to! string ~ " -"
223+ ~ uniform! ulong .to! string (36 ));
212224
213225 string [] serverArgs;
214226 static if (platformSupportsDCDUnixSockets)
@@ -218,7 +230,7 @@ class DCDComponent : ComponentWrapper
218230
219231 trace(" Start dcd-server " , serverArgs);
220232 serverPipes = raw(serverArgs ~ imports,
221- Redirect.stdin | Redirect.stderr | Redirect.stdoutToStderr);
233+ Redirect.stdin | Redirect.stderr | Redirect.stdoutToStderr);
222234 while (! serverPipes.stderr.eof)
223235 {
224236 string line = serverPipes.stderr.readln();
@@ -361,8 +373,11 @@ class DCDComponent : ComponentWrapper
361373 }
362374
363375 ret.finish(client.requestSymbolSearch(query)
364- .map! (a => DCDSearchResult(a.symbolFilePath,
365- cast (int )a.symbolLocation, [cast (char ) a.kind].idup)).array);
376+ .map! (a => DCDSearchResult(
377+ a.symbolFilePath,
378+ cast (int ) a.symbolLocation,
379+ [cast (char ) a.kind].idup
380+ )).array);
366381 }
367382 catch (Throwable t)
368383 {
@@ -382,7 +397,9 @@ class DCDComponent : ComponentWrapper
382397 void addImports (string [] imports)
383398 {
384399 imports.sort! " a<b" ;
385- knownImports = multiwayUnion([knownImports.filterNonEmpty, imports.filterNonEmpty]).array;
400+ knownImports = multiwayUnion([
401+ knownImports.filterNonEmpty, imports.filterNonEmpty
402+ ]).array;
386403 updateImports();
387404 }
388405
@@ -596,7 +613,7 @@ class DCDComponent : ComponentWrapper
596613 {
597614 calltips ~= item.definition;
598615 symbols ~= DCDCompletions.Symbol(item.symbolFilePath,
599- cast (int )item.symbolLocation, item.documentation);
616+ cast (int ) item.symbolLocation, item.documentation);
600617 }
601618 completions._calltips = calltips.data;
602619 completions._symbols = symbols.data;
@@ -608,9 +625,9 @@ class DCDComponent : ComponentWrapper
608625 foreach (item; c.completions)
609626 {
610627 identifiers ~= DCDIdentifier(item.identifier,
611- item.kind == char .init ? " " : [cast (char )item.kind].idup,
628+ item.kind == char .init ? " " : [cast (char ) item.kind].idup,
612629 item.definition, item.symbolFilePath,
613- cast (int )item.symbolLocation, item.documentation,
630+ cast (int ) item.symbolLocation, item.documentation,
614631 item.typeOf);
615632 }
616633 completions._identifiers = identifiers.data;
@@ -680,12 +697,14 @@ private:
680697
681698 auto raw (string [] args, Redirect redirect = Redirect.all)
682699 {
683- return pipeProcess (args, redirect, null , Config.none, refInstance ? instance.cwd : null );
700+ return pipeProcess (args, redirect, null , Config.none, refInstance
701+ ? instance.cwd : null );
684702 }
685703
686704 auto rawExec (string [] args)
687705 {
688- return execute (args, null , Config.none, size_t .max, refInstance ? instance.cwd : null );
706+ return execute (args, null , Config.none, size_t .max, refInstance
707+ ? instance.cwd : null );
689708 }
690709
691710 bool isSocketRunning (string socket)
0 commit comments