Skip to content

Commit

Permalink
fix some issues reported by dscanner
Browse files Browse the repository at this point in the history
  • Loading branch information
electricface authored and WebFreak001 committed Apr 16, 2024
1 parent f4ab37f commit 71b8c27
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ int main(string[] args)

//dfmt off
auto argInfo = args.getopt(
"r|require", "Adds a feature set that is required. Unknown feature sets will intentionally crash on startup", &features,
"r|require", "Adds a feature set that is required. Unknown feature sets will intentionally crash on startup",
&features,
"p|provide", "Features to let the editor handle for better integration", &provides,
"v|version", "Print version of program", &printVer,
"logfile", "Output all log into the given file instead of stderr", &setLogFile,
"loglevel", "Change the log level for output logging (" ~ [__traits(allMembers, LogLevel)].join("|") ~ ")", &setLogLevel,
"loglevel", "Change the log level for output logging (" ~ [__traits(allMembers, LogLevel)].join("|") ~ ")",
&setLogLevel,
"lang", "Change the language of GUI messages", &lang,
"wait", "Wait for a second before starting (for debugging)", &wait);
//dfmt on
Expand Down
14 changes: 8 additions & 6 deletions source/served/extension.d
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ __gshared bool registerDefaultSnippets = false;

void ensureStartedUp(UserConfiguration config)
{
static __gshared bool startedUp = false;
__gshared bool startedUp = false;
if (startedUp)
return;
startedUp = true;
Expand Down Expand Up @@ -512,7 +512,7 @@ RootSuggestion[] rootsForProject(string root, bool recursive, string[] blocked,

if (recursive)
{
PackageDescriptorLoop: foreach (pkg; tryDirEntries(root, "dub.{json,sdl}", fs.SpanMode.breadth))
foreach (pkg; tryDirEntries(root, "dub.{json,sdl}", fs.SpanMode.breadth))
{
auto dir = dirName(pkg);
if (dir.canFind(".dub"))
Expand Down Expand Up @@ -705,8 +705,8 @@ bool[] forceLoadProjects(string[] rootPaths)
__gshared bool bundleAskLoads;
shared int totalLoadedProjects;
string[] skippedRoots;
void delayedProjectActivation(WorkspaceD.Instance instance, string workspaceRoot, string workspaceUri, RootSuggestion root,
bool skipManyProjectsAction = false)
void delayedProjectActivation(WorkspaceD.Instance instance, string workspaceRoot, string workspaceUri,
RootSuggestion root, bool skipManyProjectsAction = false)
{
import core.atomic;

Expand Down Expand Up @@ -810,12 +810,14 @@ void delayedProjectActivation(WorkspaceD.Instance instance, string workspaceRoot
);
if (res == always)
{
rpc.notifyMethod("coded/updateSetting", UpdateSettingParams("forceDownloadDependencies", JsonValue("always"), true));
rpc.notifyMethod("coded/updateSetting", UpdateSettingParams("forceDownloadDependencies",
JsonValue("always"), true));
goto case DubUpgradeAction.always;
}
else if (res == never)
{
rpc.notifyMethod("coded/updateSetting", UpdateSettingParams("forceDownloadDependencies", JsonValue("never"), true));
rpc.notifyMethod("coded/updateSetting", UpdateSettingParams("forceDownloadDependencies",
JsonValue("never"), true));
}
else if (res == upgrade)
{
Expand Down
2 changes: 1 addition & 1 deletion source/served/types.d
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import workspaced.api;
deprecated("import stdlib_detect directly")
public import served.utils.stdlib_detect : parseDmdConfImports, parseDflagsImports;

enum IncludedFeatures = ["d", "workspaces"];
static immutable IncludedFeatures = ["d", "workspaces"];

__gshared MonoTime startupTime;

Expand Down

0 comments on commit 71b8c27

Please sign in to comment.