Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"default": true,
"description": "Whether the SL VS Code extension is enabled"
},
"slVscodeEdit.syntax.autoUpdate": {
"type": "boolean",
"default": true,
"description": "If false, do not update Luau-LSP and Selene configurations unless the Force Language Update is done"
},
"slVscodeEdit.ui.statusTimeoutSeconds": {
"type": "number",
"default": 3,
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/configinterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { NormalizedPath } from './hostinterface';
/** Keys used by configuration (mirrors LLConfigNames). */
export enum ConfigKey {
Enabled = 'enabled',
AutoUpdateLanguageFiles = 'syntax.autoUpdate',
ClientName = 'client.name',
ClientVersion = 'client.version',
ClientProtocolVersion = 'client.protocolVersion',
Expand Down
13 changes: 13 additions & 0 deletions src/synchservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ export class SynchService implements vscode.Disposable {
}

private async initializeSyntax(): Promise<void> {
const autoUpdate: boolean = ConfigService.getInstance().getConfig<boolean>(ConfigKey.AutoUpdateLanguageFiles) != false
if (!autoUpdate) {
return;
}
let loaded = false;
const lastSyntaxID = ConfigService.getInstance().getConfig<string>(ConfigKey.LastSyntaxID);
const languageService = LanguageService.getInstance();
Expand Down Expand Up @@ -528,6 +532,11 @@ export class SynchService implements vscode.Disposable {
//====================================================================
//#region Language version checking and management
public checkLanguageVersion(): boolean | undefined {
const autoUpdate: boolean = ConfigService.getInstance().getConfig<boolean>(ConfigKey.AutoUpdateLanguageFiles) != false
if (!autoUpdate) {
return true;
}

if (!this.syntaxId) {
return;
}
Expand All @@ -542,6 +551,10 @@ export class SynchService implements vscode.Disposable {

public async forceLanguageUpdate(): Promise<void> {
const service = LanguageService.getInstance();
const defaultSuccess = await service.changeSyntaxVersion('default');
if (!defaultSuccess) {
showWarningMessage("Failed to update default syntax.");
}
const socket = this.getWebSocket();
if (!socket || !socket.isConnected()) {
showWarningMessage("No viewer connection for syntax update.");
Expand Down
Loading