Skip to content

Issue warn if EmmyLua is old for global config #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
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
15 changes: 12 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"title": "Tarantool",
"properties": {
"tarantool.ttPath": {
"type": "string",
"default": "tt",
"markdownDescription": "Specifies a path to the TT executable, defaults to the one available in the `$PATH`."
"type": "string",
"default": "tt",
"markdownDescription": "Specifies a path to the TT executable, defaults to the one available in the `$PATH`."
}
}
}
Expand All @@ -104,6 +104,7 @@
"@types/lodash": "^4.17.16",
"@types/mocha": "^10.0.10",
"@types/node": "20.x",
"@types/semver": "^7.7.0",
"@types/vscode": "^1.88.0",
"@typescript-eslint/eslint-plugin": "^8.28.0",
"@typescript-eslint/parser": "^8.28.0",
Expand All @@ -113,6 +114,7 @@
"copy-webpack-plugin": "^13.0.0",
"eslint": "^9.23.0",
"lodash": "^4.17.21",
"semver": "^7.7.2",
"ts-loader": "^9.5.2",
"typescript": "^5.8.2",
"webpack": "^5.98.0",
Expand Down
9 changes: 9 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as vscode from 'vscode';
import * as tt from './tt';
import * as fs from 'fs';
import * as _ from 'lodash';

Check warning on line 4 in src/extension.ts

View workflow job for this annotation

GitHub Actions / Lint

Import name `_` must match one of the following formats: camelCase, PascalCase
import * as semver from 'semver';
import * as utils from './utils';

const annotationsPaths = [
Expand All @@ -19,8 +20,16 @@
const emmyrcFile = '.emmyrc.json';
const globalEmmyrcKey = 'emmylua.misc.globalConfigPath';
const globalEmmyrcPath = __dirname + `/${emmyrcFile}`;
const globalConfigEmmyluaVersion = '0.9.19';

async function initGlobalEmmyrc() {
const emmyLua = vscode.extensions.getExtension('tangzx.emmylua');
const emmyLuaVersion = emmyLua?.packageJSON.version;
if (!semver.gte(emmyLuaVersion, globalConfigEmmyluaVersion)) {
vscode.window.showWarningMessage(`Unable to set up Tarantool extension globally due to the old version of the EmmyLua extension: current version is ${emmyLuaVersion}, required version is ${globalConfigEmmyluaVersion}. Consider updating EmmyLua using marketplace or run a 'Tarantool: Initialize VS Code extension...' command having your Tarantool project opened`);
return;
}

const config = vscode.workspace.getConfiguration(undefined, null);
const configuredGlobalEmmyrcPath = config.get(globalEmmyrcKey);

Expand Down