-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Major code cleanup * Fix infinite loop in tokenizer * Fix rgb color not accepting `.0` float format
- Loading branch information
Showing
20 changed files
with
610 additions
and
505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { ConfigurationTarget, ExtensionContext, WorkspaceConfiguration, workspace } from "vscode"; | ||
|
||
export class Configuration { | ||
public static initialize(context: ExtensionContext) { | ||
// hide rpyc files if the setting is enabled | ||
const config = workspace.getConfiguration("renpy"); | ||
if (config?.excludeCompiledFilesFromWorkspace) { | ||
this.excludeCompiledFilesConfig(); | ||
} | ||
|
||
// Listen to configuration changes | ||
context.subscriptions.push( | ||
workspace.onDidChangeConfiguration((e) => { | ||
if (e.affectsConfiguration("renpy.excludeCompiledFilesFromWorkspace")) { | ||
if (workspace.getConfiguration("renpy").get("excludeCompiledFilesFromWorkspace")) { | ||
this.excludeCompiledFilesConfig(); | ||
} | ||
} | ||
}) | ||
); | ||
} | ||
|
||
public static isAutoSaveDisabled(): boolean { | ||
const config = workspace.getConfiguration("files"); | ||
const autoSave = config.get<string>("autoSave"); | ||
return autoSave === "off"; | ||
} | ||
|
||
public static compileOnDocumentSave(): boolean { | ||
const config = workspace.getConfiguration("renpy"); | ||
return config.get<boolean>("compileOnDocumentSave") === true; | ||
} | ||
|
||
public static shouldWatchFoldersForChanges(): boolean { | ||
const config = workspace.getConfiguration("renpy"); | ||
return config.get<boolean>("watchFoldersForChanges") === true; | ||
} | ||
|
||
public static getRenpyExecutablePath(): string { | ||
const config = workspace.getConfiguration("renpy"); | ||
return config.get<string>("renpyExecutableLocation") || ""; | ||
} | ||
|
||
private static excludeCompiledFilesConfig() { | ||
const renpyExclude = ["**/*.rpyc", "**/*.rpa", "**/*.rpymc", "**/cache/"]; | ||
const config = workspace.getConfiguration("files"); | ||
const workspaceExclude = config.inspect<WorkspaceConfiguration>("exclude"); | ||
const exclude = { ...workspaceExclude?.workspaceValue }; | ||
renpyExclude.forEach((element) => { | ||
if (!(element in exclude)) { | ||
Object.assign(exclude, { [element]: true }); | ||
} | ||
}); | ||
config.update("exclude", exclude, ConfigurationTarget.Workspace); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// Displayable Class | ||
"use strict"; | ||
|
||
export class Displayable { | ||
name: string; | ||
|
Oops, something went wrong.