Skip to content

Commit

Permalink
0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CppCXY committed May 20, 2024
1 parent c722bd1 commit 4f236e6
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 480 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ on:

jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
platform: win32
arch: x64
npm_config_arch: x64
- os: ubuntu-latest
platform: linux
arch: x64
npm_config_arch: x64
- os: macos-latest
platform: darwin
arch: x64
npm_config_arch: x64
- os: macos-latest
platform: darwin
arch: arm64
npm_config_arch: arm64

runs-on: ubuntu-latest

Expand All @@ -27,14 +46,13 @@ jobs:
npm_config_arch: ${{ matrix.npm_config_arch }}
- name: build
run: |
node ./build/prepare-version.js
node ./build/prepare.js
npx vsce package -o VSCode-EmmyLua.vsix
node ./build/prepare.js ${{ env.target }}
npx vsce package --target ${{ env.target }}
- name: Upload
uses: actions/upload-artifact@v2
with:
name: VSCode-EmmyLua
path: ${{ github.workspace }}/VSCode-EmmyLua.vsix
path: ${{ github.workspace }}/VSCode-EmmyLua*.vsix

publish:
runs-on: ubuntu-latest
Expand Down
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[English Change Log](CHANGELOG_EN.md)

# next-version
# 0.7.0

下个版本会升级到0.7.0, 届时java版本的语言服务会默认禁用
`NEW` dotnet实现的语言服务开始正式替代java版本的语言服务, java版本的语言服务将来会在1.0版本移除, 现在会以legacy的形式启用

# 0.6.18

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_EN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

# 0.7.0

`NEW` The language service implemented in dotnet officially begins to replace the Java version of the language service. The Java version of the language service will be removed in version 1.0 and is now enabled in a legacy form.

# 0.6.18

`NEW` Support for `---@verson` annotation, format: `---@version [>|<|>=|<=] [<framework>] <version>, ...`
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ QQ交流群:`29850775` (最新版本以及部分视频演示在群文件中下
[![donate](https://img.shields.io/badge/donate-emmy-FF69B4.svg?style=flat-square)](https://emmylua.github.io/donate.html)
[![加入QQ群](https://img.shields.io/badge/chat-QQ群-46BC99.svg?style=flat-square)](//shang.qq.com/wpa/qunwpa?idkey=f1acce081c45fbb5670ed5f880f7578df7a8b84caa5d2acec230ac957f0c1716)

![snapshot](/snapshot/overview.gif)

[更新日志](CHANGELOG.md)

[CHANGELOG](CHANGELOG_EN.md)
Expand All @@ -27,8 +25,4 @@ A: 附加调试会试图获取进程内的lua符号,判断当前的lua版本

Q: Emmy New Debug为什么连不上目标

A: 通常是由于插入代码require执行失败,或者`require("emmy_core")`返回true,这表明可执行文件没有导出lua符号

Q: 全新的语言服务何时上线?

A: 现在已经上线, 去settings下搜索emmylua.new开启后重启vscode即可, 全新语言服务基于dotnet sdk 8, 需要自行下载
A: 通常是由于插入代码require执行失败,或者`require("emmy_core")`返回true,这表明可执行文件没有导出lua符号
16 changes: 0 additions & 16 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ exports.default = {
emmyDebuggerUrl: 'https://github.com/EmmyLua/EmmyLuaDebugger/releases/download',
lanServerVersion: "0.5.16",
lanServerUrl: 'https://github.com/EmmyLua/EmmyLua-LanguageServer/releases/download',
newLanguageServerVersion: "0.2.1",
newLanguageServerVersion: "0.2.2",
newLanguageServerUrl: "https://github.com/CppCXY/EmmyLuaAnalyzer/releases/download"
}
22 changes: 0 additions & 22 deletions build/prepare-version.js

This file was deleted.

11 changes: 3 additions & 8 deletions build/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const download = require('download');
const decompress = require('decompress')
const fc = require('filecopy');
const config = require('./config').default;
const args = process.argv;

async function downloadTo(url, path) {
return new Promise((r, e) => {
Expand All @@ -20,10 +21,7 @@ async function downloadDepends() {
downloadTo(`${config.emmyDebuggerUrl}/${config.emmyDebuggerVersion}/win32-x86.zip`, 'temp/win32-x86.zip'),
downloadTo(`${config.emmyDebuggerUrl}/${config.emmyDebuggerVersion}/win32-x64.zip`, 'temp/win32-x64.zip'),
downloadTo(`${config.lanServerUrl}/${config.lanServerVersion}/EmmyLua-LS-all.jar`, 'temp/EmmyLua-LS-all.jar'),
downloadTo(`${config.newLanguageServerUrl}/${config.newLanguageServerVersion}/linux-x64.zip`, 'temp/server-linux-x64.zip'),
downloadTo(`${config.newLanguageServerUrl}/${config.newLanguageServerVersion}/darwin-arm64.zip`, 'temp/server-darwin-arm64.zip'),
downloadTo(`${config.newLanguageServerUrl}/${config.newLanguageServerVersion}/darwin-x64.zip`, 'temp/server-darwin-x64.zip'),
downloadTo(`${config.newLanguageServerUrl}/${config.newLanguageServerVersion}/win32-x64.zip`, 'temp/server-win32-x64.zip'),
downloadTo(`${config.newLanguageServerUrl}/${config.newLanguageServerVersion}/${args[2]}.zip`, 'temp/server.zip')
]);
}

Expand All @@ -46,10 +44,7 @@ async function build() {
// ls
await fc('temp/EmmyLua-LS-all.jar', 'server/EmmyLua-LS-all.jar', { mkdirp: true });
// new ls
await decompress('temp/server-linux-x64.zip', 'server/');
await decompress('temp/server-darwin-x64.zip', 'server/');
await decompress('temp/server-darwin-arm64.zip', 'server/');
await decompress('temp/server-win32-x64.zip', 'server/');
await decompress('temp/server.zip', 'server/');
}

build().catch(console.error);
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "emmylua",
"displayName": "EmmyLua",
"description": "EmmyLua for vscode",
"version": "0.6.18",
"version": "0.7.0",
"icon": "res/icon.png",
"publisher": "tangzx",
"engines": {
Expand Down Expand Up @@ -38,12 +38,6 @@
"title": "EmmyLua: Stop EmmyLua Language Server"
}
],
"snippets": [
{
"language": "lua",
"path": "./snippets/snippets.json"
}
],
"languages": [
{
"id": "lua",
Expand Down Expand Up @@ -280,10 +274,10 @@
"default": [],
"description": "%emmylua.source.roots%"
},
"emmylua.new.languageServer": {
"emmylua.legacy.languageServer": {
"type": "boolean",
"default": false,
"description": "%emmylua.new.languageServer%"
"description": "%emmylua.legacy.languageServer%"
},
"emmylua.completion.caseSensitive": {
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"emmylua.hint.overrideHint": "method override hint",
"emmylua.constructor.names" : "constructor function names",
"emmylua.requirelike.names": "set function names like require",
"emmylua.new.languageServer" : "Use new language server",
"emmylua.legacy.languageServer" : "Use legacy language server",

"emmylua.typecheck.anyTypeCanAssignToAnyDefineType": "A custom defined type can accept assignments of type any",
"emmylua.typecheck.defineAnyTypeCanBeAssignedByAnyVariable": "A custom defined type can accept any parameter",
Expand Down
2 changes: 1 addition & 1 deletion package.nls.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"emmylua.hint.overrideHint": "方法覆盖夫类方法的override hint",
"emmylua.constructor.names" : "构造函数名称列表",
"emmylua.requirelike.names": "设置类似require的函数名列表",
"emmylua.new.languageServer" : "使用emmylua新的语言服务",
"emmylua.legacy.languageServer" : "使用过时的emmylua的语言服务",

"emmylua.typecheck.anyTypeCanAssignToAnyDefineType": "定义类型能接受any 类型的赋值",
"emmylua.typecheck.defineAnyTypeCanBeAssignedByAnyVariable": "定义类型为any可以接受任何参数",
Expand Down
Binary file removed snapshot/overview.gif
Binary file not shown.
68 changes: 0 additions & 68 deletions snippets/snippets.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/emmyContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class EmmyContext {
constructor(
public debugMode: boolean,
public extensionContext: vscode.ExtensionContext,
public newLanguageServer: boolean
public oldLanguageServer: boolean
) {
this.statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
this.loadBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
Expand Down
19 changes: 7 additions & 12 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ export function activate(context: vscode.ExtensionContext) {
ctx = new EmmyContext(
process.env['EMMY_DEV'] === "true",
context,
vscode.workspace.getConfiguration("emmylua").get("new.languageServer") as boolean
vscode.workspace.getConfiguration("emmylua").get("legacy.languageServer") as boolean
);
if (!ctx.newLanguageServer) {
if (ctx.oldLanguageServer) {
javaExecutablePath = findJava();
context.subscriptions.push(vscode.commands.registerCommand("emmy.restartServer", restartServer));
context.subscriptions.push(vscode.commands.registerCommand("emmy.showReferences", showReferences));
context.subscriptions.push(vscode.commands.registerCommand("emmy.stopServer", stopServer));
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(onDidChangeConfiguration, null, context.subscriptions));
}

context.subscriptions.push(vscode.commands.registerCommand("emmy.showReferences", showReferences));
context.subscriptions.push(vscode.workspace.onDidChangeTextDocument(onDidChangeTextDocument, null, context.subscriptions));
context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(onDidChangeActiveTextEditor, null, context.subscriptions));

Expand Down Expand Up @@ -76,7 +77,7 @@ function registerDebuggers() {
context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory('emmylua_attach', factory));
context.subscriptions.push(vscode.debug.registerDebugAdapterDescriptorFactory('emmylua_launch', factory));
}
if (!ctx.newLanguageServer) {
if (!ctx.oldLanguageServer) {
context.subscriptions.push(vscode.languages.registerInlineValuesProvider('lua', {
// 不知道是否应该发到ls上再做处理
// 先简单处理一下吧
Expand Down Expand Up @@ -172,7 +173,7 @@ async function validateJava(): Promise<void> {

async function startServer() {
try {
if (!ctx.debugMode && !ctx.newLanguageServer) {
if (!ctx.debugMode && !ctx.oldLanguageServer) {
await validateJava();
}
} catch (error) {
Expand Down Expand Up @@ -231,7 +232,7 @@ async function doStartServer() {
});
return Promise.resolve(result);
};
} else if (!ctx.newLanguageServer) {
} else if (!ctx.oldLanguageServer) {
const cp = path.resolve(context.extensionPath, "server", "*");
const exePath = javaExecutablePath || "java";
serverOptions = {
Expand All @@ -247,8 +248,6 @@ async function doStartServer() {
command = path.join(
context.extensionPath,
'server',
// TODO: 减少层级
'win32-x64',
'win32-x64',
'EmmyLua.LanguageServer.exe'
)
Expand All @@ -257,8 +256,6 @@ async function doStartServer() {
command = path.join(
context.extensionPath,
'server',
// TODO
'linux-x64',
'linux-x64',
'EmmyLua.LanguageServer'
)
Expand All @@ -270,15 +267,13 @@ async function doStartServer() {
context.extensionPath,
'server',
'darwin-arm64',
'darwin-arm64',
'EmmyLua.LanguageServer'
);
} else {
command = path.join(
context.extensionPath,
'server',
'darwin-x64',
'darwin-x64',
'EmmyLua.LanguageServer'
);
}
Expand Down
Loading

0 comments on commit 4f236e6

Please sign in to comment.